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

Ouroboros.Consensus.Storage.ImmutableDB.Stream

Synopsis

Documentation

data NextItem blk Source #

Next item returned during streaming

Constructors

NoMoreItems 
NextItem blk 

newtype StreamAPI m blk a Source #

Stream items from the immutable DB

When we initialize the ledger DB, we try to find a snapshot close to the tip of the immutable DB, and then stream blocks from the immutable DB to its tip to bring the ledger up to date with the tip of the immutable DB.

In CPS form to enable the use of withXYZ style iterator init functions.

Constructors

StreamAPI 

Fields

streamAPI ∷ (IOLike m, HasHeader blk) ⇒ ImmutableDB m blk → StreamAPI m blk blk Source #

streamAPI' Source #

Arguments

∷ ∀ m blk a. (IOLike m, HasHeader blk) 
⇒ (a → m (NextItem a))

Stop condition

BlockComponent blk a 
ImmutableDB m blk 
StreamAPI m blk a 

streamAll Source #

Arguments

∷ ∀ m blk e b a. (Monad m, HasCallStack) 
StreamAPI m blk b 
Point blk

Starting point for streaming

→ (RealPoint blk → e)

Error when tip not found

→ a

Starting point when tip is found

→ (b → a → m a)

Update function for each item

ExceptT e m a 

Stream all items