Safe Haskell | None |
---|---|
Language | Haskell2010 |
Intended for qualified import
Synopsis
-
data
Handlers
m peer blk =
Handlers
{
- hChainSyncClient :: peer -> NodeToNodeVersion -> ControlMessageSTM m -> HeaderMetricsTracer m -> StrictTVar m ( AnchoredFragment ( Header blk)) -> ChainSyncClientPipelined ( Header blk) ( Point blk) ( Tip blk) m ChainSyncClientResult
- hChainSyncServer :: NodeToNodeVersion -> Follower m blk ( WithPoint blk ( SerialisedHeader blk)) -> ChainSyncServer ( SerialisedHeader blk) ( Point blk) ( Tip blk) m ()
- hBlockFetchClient :: NodeToNodeVersion -> ControlMessageSTM m -> FetchedMetricsTracer m -> BlockFetchClient ( Header blk) blk m ()
- hBlockFetchServer :: NodeToNodeVersion -> ResourceRegistry m -> BlockFetchServer ( Serialised blk) ( Point blk) m ()
- hTxSubmissionClient :: NodeToNodeVersion -> ControlMessageSTM m -> peer -> TxSubmissionClient ( GenTxId blk) ( GenTx blk) m ()
- hTxSubmissionServer :: NodeToNodeVersion -> peer -> TxSubmissionServerPipelined ( GenTxId blk) ( GenTx blk) m ()
- hKeepAliveClient :: NodeToNodeVersion -> ControlMessageSTM m -> peer -> StrictTVar m ( Map peer PeerGSV ) -> KeepAliveInterval -> KeepAliveClient m ()
- hKeepAliveServer :: NodeToNodeVersion -> peer -> KeepAliveServer m ()
- mkHandlers :: forall m blk remotePeer localPeer. ( IOLike m, MonadTime m, MonadTimer m, LedgerSupportsMempool blk, HasTxId ( GenTx blk), LedgerSupportsProtocol blk, Ord remotePeer) => NodeKernelArgs m remotePeer localPeer blk -> NodeKernel m remotePeer localPeer blk -> Handlers m remotePeer blk
-
data
Codecs
blk e m bCS bSCS bBF bSBF bTX bKA =
Codecs
{
- cChainSyncCodec :: Codec ( ChainSync ( Header blk) ( Point blk) ( Tip blk)) e m bCS
- cChainSyncCodecSerialised :: Codec ( ChainSync ( SerialisedHeader blk) ( Point blk) ( Tip blk)) e m bSCS
- cBlockFetchCodec :: Codec ( BlockFetch blk ( Point blk)) e m bBF
- cBlockFetchCodecSerialised :: Codec ( BlockFetch ( Serialised blk) ( Point blk)) e m bSBF
- cTxSubmission2Codec :: Codec ( TxSubmission2 ( GenTxId blk) ( GenTx blk)) e m bTX
- cKeepAliveCodec :: Codec KeepAlive e m bKA
- defaultCodecs :: forall m blk. ( IOLike m, SerialiseNodeToNodeConstraints blk) => CodecConfig blk -> BlockNodeToNodeVersion blk -> NodeToNodeVersion -> Codecs blk DeserialiseFailure m ByteString ByteString ByteString ByteString ByteString ByteString
- identityCodecs :: Monad m => Codecs blk CodecFailure m ( AnyMessage ( ChainSync ( Header blk) ( Point blk) ( Tip blk))) ( AnyMessage ( ChainSync ( SerialisedHeader blk) ( Point blk) ( Tip blk))) ( AnyMessage ( BlockFetch blk ( Point blk))) ( AnyMessage ( BlockFetch ( Serialised blk) ( Point blk))) ( AnyMessage ( TxSubmission2 ( GenTxId blk) ( GenTx blk))) ( AnyMessage KeepAlive )
- data ByteLimits bCS bBF bTX bKA
- byteLimits :: ByteLimits ByteString ByteString ByteString ByteString
- noByteLimits :: ByteLimits bCS bBF bTX bKA
- type Tracers m peer blk e = Tracers' peer blk e ( Tracer m)
-
data
Tracers'
peer blk e f =
Tracers
{
- tChainSyncTracer :: f ( TraceLabelPeer peer ( TraceSendRecv ( ChainSync ( Header blk) ( Point blk) ( Tip blk))))
- tChainSyncSerialisedTracer :: f ( TraceLabelPeer peer ( TraceSendRecv ( ChainSync ( SerialisedHeader blk) ( Point blk) ( Tip blk))))
- tBlockFetchTracer :: f ( TraceLabelPeer peer ( TraceSendRecv ( BlockFetch blk ( Point blk))))
- tBlockFetchSerialisedTracer :: f ( TraceLabelPeer peer ( TraceSendRecv ( BlockFetch ( Serialised blk) ( Point blk))))
- tTxSubmission2Tracer :: f ( TraceLabelPeer peer ( TraceSendRecv ( TxSubmission2 ( GenTxId blk) ( GenTx blk))))
- nullTracers :: Monad m => Tracers m peer blk e
- showTracers :: ( Show blk, Show peer, Show ( Header blk), Show ( GenTx blk), Show ( GenTxId blk), HasHeader blk, HasNestedContent Header blk) => Tracer m String -> Tracers m peer blk e
-
data
Apps
m peer bCS bBF bTX bKA a =
Apps
{
- aChainSyncClient :: ClientApp m peer bCS a
- aChainSyncServer :: ServerApp m peer bCS a
- aBlockFetchClient :: ClientApp m peer bBF a
- aBlockFetchServer :: ServerApp m peer bBF a
- aTxSubmission2Client :: ClientApp m peer bTX a
- aTxSubmission2Server :: ServerApp m peer bTX a
- aKeepAliveClient :: ClientApp m peer bKA a
- aKeepAliveServer :: ServerApp m peer bKA a
- type ClientApp m peer bytes a = NodeToNodeVersion -> ControlMessageSTM m -> peer -> Channel m bytes -> m (a, Maybe bytes)
- type ServerApp m peer bytes a = NodeToNodeVersion -> peer -> Channel m bytes -> m (a, Maybe bytes)
- mkApps :: forall m remotePeer localPeer blk e bCS bBF bTX bKA. ( IOLike m, MonadTimer m, Ord remotePeer, Exception e, LedgerSupportsProtocol blk, ShowProxy blk, ShowProxy ( Header blk), ShowProxy ( TxId ( GenTx blk)), ShowProxy ( GenTx blk)) => NodeKernel m remotePeer localPeer blk -> Tracers m remotePeer blk e -> ( NodeToNodeVersion -> Codecs blk e m bCS bCS bBF bBF bTX bKA) -> ByteLimits bCS bBF bTX bKA -> m ChainSyncTimeout -> ReportPeerMetrics m remotePeer -> Handlers m remotePeer blk -> Apps m remotePeer bCS bBF bTX bKA ()
- initiator :: MiniProtocolParameters -> NodeToNodeVersion -> Apps m ( ConnectionId peer) b b b b a -> OuroborosBundle ' InitiatorMode peer b m a Void
- initiatorAndResponder :: MiniProtocolParameters -> NodeToNodeVersion -> Apps m ( ConnectionId peer) b b b b a -> OuroborosBundle ' InitiatorResponderMode peer b m a a
- data ChainSyncTimeout = ChainSyncTimeout { }
Handlers
data Handlers m peer blk Source #
Protocol handlers for node-to-node (remote) communication
mkHandlers :: forall m blk remotePeer localPeer. ( IOLike m, MonadTime m, MonadTimer m, LedgerSupportsMempool blk, HasTxId ( GenTx blk), LedgerSupportsProtocol blk, Ord remotePeer) => NodeKernelArgs m remotePeer localPeer blk -> NodeKernel m remotePeer localPeer blk -> Handlers m remotePeer blk Source #
Codecs
data Codecs blk e m bCS bSCS bBF bSBF bTX bKA Source #
Node-to-node protocol codecs needed to run
Handlers
.
Codecs | |
|
defaultCodecs :: forall m blk. ( IOLike m, SerialiseNodeToNodeConstraints blk) => CodecConfig blk -> BlockNodeToNodeVersion blk -> NodeToNodeVersion -> Codecs blk DeserialiseFailure m ByteString ByteString ByteString ByteString ByteString ByteString Source #
Protocol codecs for the node-to-node protocols
identityCodecs :: Monad m => Codecs blk CodecFailure m ( AnyMessage ( ChainSync ( Header blk) ( Point blk) ( Tip blk))) ( AnyMessage ( ChainSync ( SerialisedHeader blk) ( Point blk) ( Tip blk))) ( AnyMessage ( BlockFetch blk ( Point blk))) ( AnyMessage ( BlockFetch ( Serialised blk) ( Point blk))) ( AnyMessage ( TxSubmission2 ( GenTxId blk) ( GenTx blk))) ( AnyMessage KeepAlive ) Source #
Identity codecs used in tests.
Byte Limits
data ByteLimits bCS bBF bTX bKA Source #
Per mini-protocol byte limits; For each mini-protocol they provide per-state byte size limits, i.e. how much data can arrive from the network.
They don't depend on the instantiation of the protocol parameters (which
block type is used, etc.), hence the use of
RankNTypes
.
noByteLimits :: ByteLimits bCS bBF bTX bKA Source #
Tracers
type Tracers m peer blk e = Tracers' peer blk e ( Tracer m) Source #
A record of
Tracer
s for the different protocols.
data Tracers' peer blk e f Source #
Tracers | |
|
nullTracers :: Monad m => Tracers m peer blk e Source #
Use a
nullTracer
for each protocol.
showTracers :: ( Show blk, Show peer, Show ( Header blk), Show ( GenTx blk), Show ( GenTxId blk), HasHeader blk, HasNestedContent Header blk) => Tracer m String -> Tracers m peer blk e Source #
Applications
data Apps m peer bCS bBF bTX bKA a Source #
Applications for the node-to-node protocols
See
MuxApplication
Apps | |
|
type ClientApp m peer bytes a = NodeToNodeVersion -> ControlMessageSTM m -> peer -> Channel m bytes -> m (a, Maybe bytes) Source #
A node-to-node application
type ServerApp m peer bytes a = NodeToNodeVersion -> peer -> Channel m bytes -> m (a, Maybe bytes) Source #
:: forall m remotePeer localPeer blk e bCS bBF bTX bKA. ( IOLike m, MonadTimer m, Ord remotePeer, Exception e, LedgerSupportsProtocol blk, ShowProxy blk, ShowProxy ( Header blk), ShowProxy ( TxId ( GenTx blk)), ShowProxy ( GenTx blk)) | |
=> NodeKernel m remotePeer localPeer blk |
Needed for bracketing only |
-> Tracers m remotePeer blk e | |
-> ( NodeToNodeVersion -> Codecs blk e m bCS bCS bBF bBF bTX bKA) | |
-> ByteLimits bCS bBF bTX bKA | |
-> m ChainSyncTimeout | |
-> ReportPeerMetrics m remotePeer | |
-> Handlers m remotePeer blk | |
-> Apps m remotePeer bCS bBF bTX bKA () |
Construct the
NetworkApplication
for the node-to-node protocols
Projections
initiator :: MiniProtocolParameters -> NodeToNodeVersion -> Apps m ( ConnectionId peer) b b b b a -> OuroborosBundle ' InitiatorMode peer b m a Void Source #
A projection from
NetworkApplication
to a client-side
OuroborosApplication
for the node-to-node protocols.
Implementation note: network currently doesn't enable protocols conditional
on the protocol version, but it eventually may; this is why
_version
is
currently unused.
initiatorAndResponder :: MiniProtocolParameters -> NodeToNodeVersion -> Apps m ( ConnectionId peer) b b b b a -> OuroborosBundle ' InitiatorResponderMode peer b m a a Source #
A bi-directional network applicaiton.
Implementation note: network currently doesn't enable protocols conditional
on the protocol version, but it eventually may; this is why
_version
is
currently unused.
Re-exports
data ChainSyncTimeout Source #
Configurable timeouts
These are configurable for at least the following reasons.
o So that deployment and testing can use different values.
o So that a net running Praos can better cope with streaks of empty slots.
(See
input-output-hk/ouroboros-network#2245
.)