Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
A node client that applies a fold to the stream of blocks.
Unlike foldBlocks
from Api
, this one supports rollbacks.
Synopsis
- data CatchingUp
- catchingUpWithNode ∷ ChainPoint → Maybe BlockNo → Maybe ChainPoint → CatchingUp
- caughtUpWithNode ∷ ChainTip → CatchingUp
- resumingFrom ∷ ResumingFrom → CatchingUp
- catchingUp ∷ CatchingUp → Bool
- caughtUp ∷ CatchingUp → Bool
- getClientPoint ∷ CatchingUp → JSONChainPoint
- shouldLog ∷ CatchingUp → Bool
- foldClient ∷ ∀ s. s → Env → (CatchingUp → s → BlockInMode CardanoMode → IO (Maybe s)) → PipelinedLedgerStateClient
- foldClient' ∷ ∀ s w. Monoid w ⇒ s → Env → (ChainPoint → w → s → IO (w, s)) → (CatchingUp → s → BlockInMode CardanoMode → IO (Maybe (w, s))) → PipelinedLedgerStateClient
Documentation
data CatchingUp Source #
Whether we have fully caught up with the node
CatchingUpWithNode | Client is still catching up |
CaughtUpWithNode | Client fully caught up (client tip == server tip) |
Instances
catchingUp ∷ CatchingUp → Bool Source #
caughtUp ∷ CatchingUp → Bool Source #
shouldLog ∷ CatchingUp → Bool Source #
Whether it is a good time to log something. Returns true if
- The client has fully caught up with the node, OR
- The client is catching up and the block number is a multiple of 10.000
∷ ∀ s. s | Initial state |
→ Env | Node connection data |
→ (CatchingUp → s → BlockInMode CardanoMode → IO (Maybe s)) | Fold |
→ PipelinedLedgerStateClient |
Run the client until Nothing
is returned
∷ ∀ s w. Monoid w | |
⇒ s | Initial state |
→ Env | Node connection data |
→ (ChainPoint → w → s → IO (w, s)) | Rollback |
→ (CatchingUp → s → BlockInMode CardanoMode → IO (Maybe (w, s))) | Fold |
→ PipelinedLedgerStateClient |
A variant of foldClient
with more detailed control over rollbacks.