ouroboros-network-0.1.0.1: A networking layer for the Ouroboros blockchain protocol
Safe Haskell None
Language Haskell2010

Ouroboros.Network.Protocol.BlockFetch.Client

Synopsis

Documentation

newtype BlockFetchClient block point m a Source #

Block fetch client type for requesting ranges of blocks and handling responses.

Constructors

BlockFetchClient

Fields

data BlockFetchRequest block point m a where Source #

Constructors

SendMsgRequestRange :: ChainRange point -> BlockFetchResponse block m a -> BlockFetchClient block point m a -> BlockFetchRequest block point m a

Request a chain range, supply handler for incoming blocks and a continuation.

SendMsgClientDone :: a -> BlockFetchRequest block point m a

Client terminating the block-fetch protocol.

data BlockFetchReceiver block m Source #

Blocks are streamed and block receiver will handle each one when it comes, it also needs to handle errors sent back from the server.

Constructors

BlockFetchReceiver

Fields

data BlockFetchClientPipelined block point m a where Source #

A BlockFetch client designed for running the protcol in a pipelined way.

Constructors

BlockFetchClientPipelined :: BlockFetchSender Z c block point m a -> BlockFetchClientPipelined block point m a

A BlockFetchSender , but starting with zero outstanding pipelined responses, and for any internal collect type c .

data BlockFetchSender n c block point m a where Source #

A BlockFetchSender with n outstanding stream of block bodies.

Constructors

SendMsgRequestRangePipelined :: ChainRange point -> c -> ( Maybe block -> c -> m c) -> BlockFetchSender ( S n) c block point m a -> BlockFetchSender n c block point m a

Send a MsgRequestRange but do not wait for response. Supply a monadic action which runs on each received block and which updates the internal received value c . c could be a Monoid, though it's more general this way.

CollectBlocksPipelined :: Maybe ( BlockFetchSender ( S n) c block point m a) -> (c -> BlockFetchSender n c block point m a) -> BlockFetchSender ( S n) c block point m a

Collect the result of a previous pipelined receive action

SendMsgDonePipelined :: a -> BlockFetchSender Z c block point m a

Termination of the block-fetch protocol.

blockFetchClientPeerSender :: forall n block point c m a. Monad m => BlockFetchSender n c block point m a -> PeerSender ( BlockFetch block point) AsClient BFIdle n c m a Source #