Interface: Checkpointer

fabric-network. Checkpointer

Persists the current block and transactions within that block to enable event listening to be resumed following an application outage. Default implementations can be obtained from DefaultCheckpointers. Application developers are encouraged to build their own implementations that use a persistent store suitable to their environment.

Methods


<async> addTransactionId(transactionId)

Add a transaction ID for the current block. Typically called once a transaction has been processed.
Parameters:
Name Type Description
transactionId string A transaction ID.
Returns:
Type
Promise.<void>

<async> getBlockNumber()

Get the current block number, or undefined if there is no previously saved state.
Returns:
A block number.
Type
Promise.<(Long|undefined)>

<async> getTransactionIds()

Get the transaction IDs processed within the current block.
Returns:
Transaction IDs.
Type
Promise.<Set.<string>>

<async> setBlockNumber(blockNumber)

Set the current block number. Also clears the stored transaction IDs. Typically set when the previous block has been processed.
Parameters:
Name Type Description
blockNumber Long A block number.
Returns:
Type
Promise.<void>