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

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

SendMsgReplyTxIdsBlockingReplyList 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 TokBlockingStyle (k ∷ StBlockingStyle) where Source #

The value level equivalent of StBlockingStyle.

This is also used in MsgRequestTxIds where it is interpreted (and can be encoded) as a Bool with True for blocking, and False for non-blocking.

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.

Instances

Instances details
Eq a ⇒ Eq (BlockingReplyList blocking a) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

Methods

(==)BlockingReplyList blocking a → BlockingReplyList blocking a → Bool Source #

(/=)BlockingReplyList blocking a → BlockingReplyList blocking a → Bool Source #

Show a ⇒ Show (BlockingReplyList blocking a) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

Methods

showsPrecIntBlockingReplyList blocking a → ShowS Source #

showBlockingReplyList blocking a → String Source #

showList ∷ [BlockingReplyList blocking a] → ShowS Source #

Execution as a typed protocol

txSubmissionClientPeer ∷ ∀ txid tx m a. Monad m ⇒ TxSubmissionClient txid tx m a → Peer (TxSubmission2 txid tx) AsClient StInit m a Source #

A non-pipelined Peer representing the TxSubmissionClient.