Options
All
  • Public
  • Public/Protected
  • All
Menu

Reads from an EOSIO nodeos node to get blocks of actions. It is important to note that deferred transactions will not be included, as these are currently not accessible without the use of plugins.

Hierarchy

Index

Constructors

constructor

  • new NodeosActionReader(nodeosEndpoint?: string, startAtBlock?: number, onlyIrreversible?: boolean, maxHistoryLength?: number, requestInstance?: any): NodeosActionReader

Properties

Protected blockHistory

blockHistory: Block[] = []

Protected currentBlockData

currentBlockData: Block | null = null

currentBlockNumber

currentBlockNumber: number

headBlockNumber

headBlockNumber: number = 0

isFirstBlock

isFirstBlock: boolean = true

Protected maxHistoryLength

maxHistoryLength: number

Protected nodeosEndpoint

nodeosEndpoint: string

Protected onlyIrreversible

onlyIrreversible: boolean

Protected requestInstance

requestInstance: any

startAtBlock

startAtBlock: number

Methods

getBlock

getHeadBlockNumber

  • getHeadBlockNumber(): Promise<number>

Protected httpRequest

  • httpRequest(method: string, requestParams: any): Promise<any>

nextBlock

  • nextBlock(): Promise<[Block, boolean]>

rollback

  • rollback(): Promise<void>
  • Incrementally rolls back reader state one block at a time, comparing the blockHistory with newly fetched blocks. Rollback is finished when either the current block's previous hash matches the previous block's hash, or when history is exhausted.

    Returns Promise<void>

Protected rollbackExhausted

  • rollbackExhausted(): void

seekToBlock

  • seekToBlock(blockNumber: number): Promise<void>