ouroboros-network-protocols
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.Protocol.TxSubmission2.Server

Description

A view of the transaction submission protocol from the point of view of the server.

This provides a view that uses less complex types and should be easier to use than the underlying typed protocol itself.

For execution, a conversion into the typed protocol is provided.

Synopsis

Protocol type for the server

The protocol states from the point of view of the server.

data TxSubmissionServerPipelined txid tx (m :: Type -> Type) a where Source #

Constructors

TxSubmissionServerPipelined :: forall (m :: Type -> Type) txid tx a. m (ServerStIdle 'Z txid tx m a) -> TxSubmissionServerPipelined txid tx m a 

data ServerStIdle (n :: N) txid tx (m :: Type -> Type) a where Source #

Constructors

SendMsgRequestTxIdsBlocking 

Fields

SendMsgRequestTxIdsPipelined :: forall (m :: Type -> Type) (n :: N) txid tx a. NumTxIdsToAck -> NumTxIdsToReq -> m (ServerStIdle ('S n) txid tx m a) -> ServerStIdle n txid tx m a 
SendMsgRequestTxsPipelined :: forall txid (m :: Type -> Type) (n :: N) tx a. [txid] -> m (ServerStIdle ('S n) txid tx m a) -> ServerStIdle n txid tx m a 
CollectPipelined :: forall (n1 :: N) txid tx (m :: Type -> Type) a. Maybe (ServerStIdle ('S n1) txid tx m a) -> (Collect txid tx -> m (ServerStIdle n1 txid tx m a)) -> ServerStIdle ('S n1) txid tx m a

Collect a pipelined result.

data Collect txid tx Source #

This is the type of the pipelined results, collected by CollectPipelined. This protocol can pipeline requests for transaction ids and transactions, so we use a sum of either for collecting the responses.

Constructors

CollectTxIds NumTxIdsToReq [(txid, SizeInBytes)]

The result of SendMsgRequestTxIdsPipelined. It also carries the number of txids originally requested.

CollectTxs [txid] [tx]

The result of SendMsgRequestTxsPipelined. The actual reply only contains the transactions sent, but this pairs them up with the transactions requested. This is because the peer can determine that some transactions are no longer needed.

Execution as a typed protocol