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

Ouroboros.Network.Protocol.TxSubmission2.Client

Description

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

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

For execution, txSubmissionClientPeer is provided for conversion into the typed protocol.

Synopsis

Protocol type for the client

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

newtype TxSubmissionClient txid tx m a Source #

The client side of the transaction submission protocol.

The peer in the client role submits transactions to the peer in the server role.

Constructors

TxSubmissionClient

Fields

data ClientStIdle txid tx m a Source #

In the StIdle protocol state, the client does not have agency. Instead it is waiting for:

  • a request for transaction ids (blocking or non-blocking)
  • a request for a given list of transactions
  • a termination message

It must be prepared to handle any of these.

Constructors

ClientStIdle

Fields

data ClientStTxIds blocking txid tx m a where Source #

Constructors

SendMsgReplyTxIds :: BlockingReplyList blocking (txid, TxSizeInBytes ) -> ClientStIdle txid tx m a -> ClientStTxIds blocking txid tx m a
SendMsgDone :: a -> ClientStTxIds StBlocking txid tx m a

In the blocking case, the client can terminate the protocol. This could be used when the client knows there will be no more transactions to submit.

data ClientStTxs txid tx m a where Source #

Constructors

SendMsgReplyTxs :: [tx] -> ClientStIdle txid tx m a -> ClientStTxs txid tx m a

type TxSizeInBytes = Word32 Source #

Transactions are typically not big, but in principle in future we could have ones over 64k large.

data BlockingReplyList (blocking :: StBlockingStyle ) a where Source #

We have requests for lists of things. In the blocking case the corresponding reply must be non-empty, whereas in the non-blocking case and empty reply is fine.

Execution as a typed protocol