ChainPersistence extension
Saving a chain and keeping its blocks.
- on
Methods
-
archivedBlock(
int height) → Uint8List -
Available on Chain, provided by the ChainPersistence extension
The archived encoded block atheight. -
archivedCertificate(
int height) → Uint8List -
Available on Chain, provided by the ChainPersistence extension
The commit certificate of the archived block atheight. -
archiveRange(
) → ArchiveRange? -
Available on Chain, provided by the ChainPersistence extension
The archived height range, or null while the archive is empty. -
enableArchive(
) → void -
Available on Chain, provided by the ChainPersistence extension
Starts keeping every block this chain commits from now on, with its commit certificate, inside the handle and its snapshots. Throws when the engine is not BFT. -
pruneArchive(
int height) → int -
Available on Chain, provided by the ChainPersistence extension
Drops archived blocks belowheightand returns how many. -
snapshot(
) → Uint8List -
Available on Chain, provided by the ChainPersistence extension
Everything this chain needs to resume after a restart: the ledger, the receipts of the tip block, the engine's consensus state and, when enabled, the block archive. It holds no secret key and is bound to the genesis hash. Transactions queued for the next proposal are not saved. -
tip(
) → Uint8List -
Available on Chain, provided by the ChainPersistence extension
The current tip header, the genesis header before any block.