ouroboros-consensus-0.18.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Consensus.Node.InitStorage

Synopsis

Documentation

class NodeInitStorage blk where Source #

Functionality needed to initialise the storage layer of the node.

Minimal complete definition

nodeImmutableDbChunkInfo, nodeCheckIntegrity

Methods

nodeImmutableDbChunkInfoStorageConfig blk → ChunkInfo Source #

The ChunkInfo to use for the ImmutableDB, i.e., how many slots to put together in a single chunk file.

For example, for Byron, one would use the epoch size.

nodeCheckIntegrityStorageConfig blk → blk → Bool Source #

Check the integrity of a block, i.e., that it has not been corrupted by a bitflip.

Check this by, e.g., verifying whether the block has a valid signature and that the hash of the body matches the body hash stores in the header.

This does not check the validity of the contents of the block, e.g., whether the transactions are valid w.r.t. the ledger, or whether it's sent by a malicious node.

nodeInitChainDBIOLike m ⇒ StorageConfig blk → InitChainDB m blk → m () Source #

This function is called when starting up the node, right after the ChainDB was opened, and before we connect to other nodes and start block production.

This function can be used to, for example, create the genesis EBB in case the chain(DB) is empty.

We only provide a limited interface to the chain DB. This is primarily useful for the definition of combinators (which may need to turn a InitChainDB for one type of block into an InitChainDB for a closely related type of block).