cardano-streaming-1.2.0.0
Safe Haskell None
Language Haskell2010

Cardano.Streaming

Synopsis

Documentation

withChainSyncEventStream Source #

Arguments

:: FilePath

Path to the node socket

-> NetworkId
-> [ ChainPoint ]

The point on the chain to start streaming from

-> ( Stream ( Of ( ChainSyncEvent ( BlockInMode CardanoMode ))) IO r -> IO b)

The stream consumer

-> IO b

withChainSyncEventStream uses the chain-sync mini-protocol to connect to a locally running node and fetch blocks from the given starting point.

data ChainSyncEvent a Source #

Instances

Instances details
Functor ChainSyncEvent Source #
Instance details

Defined in Cardano.Streaming.Helpers

Show a => Show ( ChainSyncEvent a) Source #
Instance details

Defined in Cardano.Streaming.Helpers

Generic ( ChainSyncEvent a) Source #
Instance details

Defined in Cardano.Streaming.Helpers

type Rep ( ChainSyncEvent a) Source #
Instance details

Defined in Cardano.Streaming.Helpers

Stream blocks and ledger states

blocks :: LocalNodeConnectInfo CardanoMode -> ChainPoint -> Stream ( Of ( ChainSyncEvent ( BlockInMode CardanoMode ))) IO r Source #

Create stream of ChainSyncEvent (BlockInMode CardanoMode) from a node at socketPath with networkId starting at point .

foldLedgerState :: Env -> LedgerStateHistory -> ValidationMode -> Stream ( Of ( ChainSyncEvent ( BlockInMode CardanoMode ))) IO r -> Stream ( Of LedgerState ) IO r Source #

Fold a stream of blocks into a stream of ledger states. This is implemented in a similar way as foldBlocks in cardano-api:Cardano.Api.LedgerState, the difference being that this keeps waiting for more blocks when chainsync server and client are fully synchronized.

ignoreRollbacks :: Monad m => Stream ( Of ( ChainSyncEvent a)) m r -> Stream ( Of a) m r Source #

Ignore rollback events in the chainsync event stream. Useful for monitor which blocks has been seen by the node, regardless whether they are permanent.