convex-node-client-0.2.0.0: Conveniences for cardano-node clients
Safe HaskellSafe-Inferred
LanguageHaskell2010

Convex.NodeClient.Fold

Description

A node client that applies a fold to the stream of blocks. Unlike foldBlocks from Api, this one supports rollbacks.

Synopsis

Documentation

data CatchingUp Source #

Whether we have fully caught up with the node

Constructors

CatchingUpWithNode

Client is still catching up

CaughtUpWithNode

Client fully caught up (client tip == server tip)

Fields

Instances

Instances details
FromJSON CatchingUp Source # 
Instance details

Defined in Convex.NodeClient.Fold

ToJSON CatchingUp Source # 
Instance details

Defined in Convex.NodeClient.Fold

Generic CatchingUp Source # 
Instance details

Defined in Convex.NodeClient.Fold

Associated Types

type Rep CatchingUpTypeType Source #

Show CatchingUp Source # 
Instance details

Defined in Convex.NodeClient.Fold

Eq CatchingUp Source # 
Instance details

Defined in Convex.NodeClient.Fold

type Rep CatchingUp Source # 
Instance details

Defined in Convex.NodeClient.Fold

type Rep CatchingUp = D1 ('MetaData "CatchingUp" "Convex.NodeClient.Fold" "convex-node-client-0.2.0.0-inplace" 'False) (C1 ('MetaCons "CatchingUpWithNode" 'PrefixI 'True) (S1 ('MetaSel ('Just "clientPoint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSONChainPoint) :*: (S1 ('MetaSel ('Just "clientBlockNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe JSONBlockNo)) :*: S1 ('MetaSel ('Just "serverTip") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe JSONChainPoint)))) :+: C1 ('MetaCons "CaughtUpWithNode" 'PrefixI 'True) (S1 ('MetaSel ('Just "tip") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSONChainTip)))

shouldLogCatchingUpBool 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

foldClient Source #

Arguments

∷ ∀ s. s

Initial state

Env

Node connection data

→ (CatchingUp → s → BlockInMode CardanoModeIO (Maybe s))

Fold

PipelinedLedgerStateClient 

Run the client until Nothing is returned

foldClient' Source #

Arguments

∷ ∀ s w. Monoid w 
⇒ s

Initial state

Env

Node connection data

→ (ChainPoint → w → s → IO (w, s))

Rollback

→ (CatchingUp → s → BlockInMode CardanoModeIO (Maybe (w, s)))

Fold

PipelinedLedgerStateClient 

A variant of foldClient with more detailed control over rollbacks.