Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- withChainSyncEventStream :: FilePath -> NetworkId -> [ ChainPoint ] -> ( Stream ( Of ( ChainSyncEvent ( BlockInMode CardanoMode ))) IO r -> IO b) -> IO b
- data ChainSyncEvent a
- data ChainSyncEventException = NoIntersectionFound
- mkConnectInfo :: Env -> FilePath -> LocalNodeConnectInfo CardanoMode
- mkLocalNodeConnectInfo :: NetworkId -> FilePath -> LocalNodeConnectInfo CardanoMode
- blocks :: LocalNodeConnectInfo CardanoMode -> ChainPoint -> Stream ( Of ( ChainSyncEvent ( BlockInMode CardanoMode ))) IO r
- blocksPipelined :: Word32 -> LocalNodeConnectInfo CardanoMode -> ChainPoint -> Stream ( Of ( ChainSyncEvent ( BlockInMode CardanoMode ))) IO r
- ledgerStates :: FilePath -> FilePath -> ValidationMode -> Stream ( Of LedgerState ) IO r
- ledgerStatesPipelined :: Word32 -> FilePath -> FilePath -> ValidationMode -> Stream ( Of LedgerState ) IO r
- foldLedgerState :: Env -> LedgerStateHistory -> ValidationMode -> Stream ( Of ( ChainSyncEvent ( BlockInMode CardanoMode ))) IO r -> Stream ( Of LedgerState ) IO r
- foldLedgerStateEvents :: Env -> LedgerStateHistory -> ValidationMode -> Stream ( Of ( ChainSyncEvent ( BlockInMode CardanoMode ))) IO r -> Stream ( Of ( BlockInMode CardanoMode , LedgerStateEvents)) IO r
- getEnvAndInitialLedgerStateHistory :: FilePath -> IO ( Env , LedgerStateHistory)
- ignoreRollbacks :: Monad m => Stream ( Of ( ChainSyncEvent a)) m r -> Stream ( Of a) m r
Documentation
withChainSyncEventStream Source #
:: 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
data ChainSyncEventException Source #
Instances
mkConnectInfo :: Env -> FilePath -> LocalNodeConnectInfo CardanoMode Source #
Derive LocalNodeConnectInfo from Env.
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
.
blocksPipelined :: Word32 -> LocalNodeConnectInfo CardanoMode -> ChainPoint -> Stream ( Of ( ChainSyncEvent ( BlockInMode CardanoMode ))) IO r Source #
ledgerStates :: FilePath -> FilePath -> ValidationMode -> Stream ( Of LedgerState ) IO r Source #
Get a stream of permanent ledger states
ledgerStatesPipelined :: Word32 -> FilePath -> FilePath -> ValidationMode -> Stream ( Of LedgerState ) IO r Source #
Get a stream of ledger states over a pipelined chain sync
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.
foldLedgerStateEvents :: Env -> LedgerStateHistory -> ValidationMode -> Stream ( Of ( ChainSyncEvent ( BlockInMode CardanoMode ))) IO r -> Stream ( Of ( BlockInMode CardanoMode , LedgerStateEvents)) IO r Source #
Like
foldLedgerState
, but also produces blocks and
LedgerEvent
s.
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.