ouroboros-network-0.1.0.0: A networking layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

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

SendMsgRequestRangeChainRange 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 BlockFetchResponse block m a Source #

Constructors

BlockFetchResponse 

Fields

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

blockFetchClientPeer ∷ ∀ block point m a. Monad m ⇒ BlockFetchClient block point m a → Peer (BlockFetch block point) AsClient BFIdle m a Source #

data BlockFetchClientPipelined block point m a where Source #

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

Constructors

BlockFetchClientPipelinedBlockFetchSender 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

SendMsgRequestRangePipelinedChainRange 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.

CollectBlocksPipelinedMaybe (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.

blockFetchClientPeerPipelined ∷ ∀ block point m a. Monad m ⇒ BlockFetchClientPipelined block point m a → PeerPipelined (BlockFetch block point) AsClient BFIdle m a Source #

blockFetchClientPeerSender ∷ ∀ 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 #