Module chainstore

Source
Expand description

This module defines the ChainStore trait, which provides the Floresta node API for persisting and retrieving blockchain data (headers, block hashes linked to a height, the best chain data, and the accumulator for each block).

It also defines two important types for our storage format:

  • DiskBlockHeader: A block header linked to its validation-state metadata
  • BestChain: Tracks the current best chain, last valid block, and fork tips

Structs§

BestChain
Internal representation of the chain we are in

Enums§

DiskBlockHeader
This enum is used to store a block header in the database. It contains the header along with metadata about the validation state of the block, and, if applicable, also its height.

Traits§

ChainStore
A trait defining methods for interacting with our chain database. These methods will be used by the ChainState to save and retrieve data about the blockchain, likely on disk.