Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- txSubmissionClient :: forall txid tx (m :: Type -> Type). (Ord txid, Show txid, Monad m) => Tracer m (TraceEventClient txid tx) -> (tx -> txid) -> (tx -> SizeInBytes) -> Word16 -> [tx] -> TxSubmissionClient txid tx m ()
- txSubmissionServer :: forall txid tx (m :: Type -> Type). (Ord txid, Monad m) => Tracer m (TraceEventServer txid tx) -> (tx -> txid) -> Word16 -> Word16 -> Word16 -> TxSubmissionServerPipelined txid tx m [tx]
- data TraceEventClient txid tx
- = EventRecvMsgRequestTxIds (StrictSeq txid) (Map txid tx) [tx] NumTxIdsToAck NumTxIdsToReq
- | EventRecvMsgRequestTxs (StrictSeq txid) (Map txid tx) [tx] [txid]
- data TraceEventServer txid tx
- = EventRequestTxIdsBlocking (ServerState txid tx) NumTxIdsToAck NumTxIdsToReq
- | EventRequestTxIdsPipelined (ServerState txid tx) NumTxIdsToAck NumTxIdsToReq
- | EventRequestTxsPipelined (ServerState txid tx) [txid]
Documentation
:: forall txid tx (m :: Type -> Type). (Ord txid, Show txid, Monad m) | |
=> Tracer m (TraceEventClient txid tx) | |
-> (tx -> txid) | |
-> (tx -> SizeInBytes) | |
-> Word16 | Maximum number of unacknowledged txids allowed |
-> [tx] | |
-> TxSubmissionClient txid tx m () |
An example
which sends transactions from a fixed
list of transactions.TxSubmissionClient
It is intended to illustrate the protocol or for use in tests. The client enforces aspects of the protocol. It will fail with a protocol error if the peer asks for a transaction which is not in the unacknowledged set. The unacknowledged set is managed such that things are removed after having been requested. The net effect is that the peer can only ask for * If a server will ask for the same transaction twice.
:: forall txid tx (m :: Type -> Type). (Ord txid, Monad m) | |
=> Tracer m (TraceEventServer txid tx) | |
-> (tx -> txid) | |
-> Word16 | Maximum number of unacknowledged txids |
-> Word16 | Maximum number of txids to request in any one go |
-> Word16 | Maximum number of txs to request in any one go |
-> TxSubmissionServerPipelined txid tx m [tx] |
An example transaction submission server.
It collects and returns all the transactions that the client submits. This is suitable for tests and using as a starting template for a full version.
Note that this example does not respect any overall byte limit on pipelining and does not make any delta-Q info to optimises the pipelining decisions.
data TraceEventClient txid tx Source #
EventRecvMsgRequestTxIds (StrictSeq txid) (Map txid tx) [tx] NumTxIdsToAck NumTxIdsToReq | |
EventRecvMsgRequestTxs (StrictSeq txid) (Map txid tx) [tx] [txid] |
Instances
(Show txid, Show tx) => Show (TraceEventClient txid tx) Source # | |
Defined in Ouroboros.Network.Protocol.TxSubmission2.Examples showsPrec :: Int -> TraceEventClient txid tx -> ShowS # show :: TraceEventClient txid tx -> String # showList :: [TraceEventClient txid tx] -> ShowS # |
data TraceEventServer txid tx Source #
EventRequestTxIdsBlocking (ServerState txid tx) NumTxIdsToAck NumTxIdsToReq | |
EventRequestTxIdsPipelined (ServerState txid tx) NumTxIdsToAck NumTxIdsToReq | |
EventRequestTxsPipelined (ServerState txid tx) [txid] |
Instances
(Show txid, Show tx) => Show (TraceEventServer txid tx) Source # | |
Defined in Ouroboros.Network.Protocol.TxSubmission2.Examples showsPrec :: Int -> TraceEventServer txid tx -> ShowS # show :: TraceEventServer txid tx -> String # showList :: [TraceEventServer txid tx] -> ShowS # |