ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Storage.LedgerDB

Contents

Synopsis

API

Impl

openDB Source #

Arguments

∷ (IOLike m, LedgerSupportsProtocol blk, InspectLedger blk, HasCallStack, HasHardForkHistory blk, LedgerSupportsLedgerDB blk) 
Complete LedgerDbArgs m blk

Stateless initializaton arguments

StreamAPI m blk blk

Stream source for blocks.

After reading a snapshot from disk, the ledger DB will be brought up to date with the tip of this steam of blocks. The corresponding ledger state can then be used as the starting point for chain selection in the ChainDB driver.

Point blk

The Replay goal i.e. the tip of the stream of blocks.

ResolveBlock m blk

How to get blocks from the ChainDB

GetVolatileSuffix m blk 
WithTempRegistry st m (LedgerDB' m blk, Word64) 

Open the LedgerDB database

It's crucial that this is scoped within the same runWithTempRegistry call that includes the allocation of the ChainDB itself into the top-level resource registry. That's why the whole openDB function is in WithTempRegistry even though there's just the one part of it that actually puts stuff in that registry.

openDBInternal ∷ ∀ m blk db (n ∷ TypeType) st. (IOLike m, LedgerSupportsProtocol blk, InspectLedger blk, HasCallStack) ⇒ Complete LedgerDbArgs m blk → InitDB db m blk → SnapshotManager m n blk st → StreamAPI m blk blk → Point blk → m (LedgerDB' m blk, Word64, TestInternals' m blk) Source #

Open the ledger DB and expose internals for testing purposes