| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Network.NodeToNode
Description
Intended for qualified import
Synopsis
- data Handlers (m ∷ Type → Type) addr blk = Handlers {
- hChainSyncClient ∷ ConnectionId addr → IsBigLedgerPeer → DynamicEnv m blk → ChainSyncClientPipelined (Header blk) (Point blk) (Tip blk) m ChainSyncClientResult
- hChainSyncServer ∷ ConnectionId addr → NodeToNodeVersion → Follower m blk (WithPoint blk (SerialisedHeader blk)) → ChainSyncServer (SerialisedHeader blk) (Point blk) (Tip blk) m ()
- hBlockFetchClient ∷ NodeToNodeVersion → ControlMessageSTM m → FetchedMetricsTracer m → BlockFetchClient (HeaderWithTime blk) blk blk m ()
- hBlockFetchServer ∷ ConnectionId addr → NodeToNodeVersion → ResourceRegistry m → BlockFetchServer (Serialised blk) (Point blk) m ()
- hTxSubmissionClient ∷ NodeToNodeVersion → ControlMessageSTM m → ConnectionId addr → TxSubmissionClient (GenTxId blk) (GenTx blk) m ()
- hTxSubmissionServer ∷ NodeToNodeVersion → ConnectionId addr → Either (TxSubmissionServerPipelined (GenTxId blk) (GenTx blk) m ()) (PeerTxAPI m (GenTxId blk) (GenTx blk) → TxSubmissionServerPipelined (GenTxId blk) (GenTx blk) m ())
- hPerasCertDiffusionClient ∷ NodeToNodeVersion → ControlMessageSTM m → ConnectionId addr → PerasCertDiffusionInboundPipelined blk m ()
- hPerasCertDiffusionServer ∷ NodeToNodeVersion → ConnectionId addr → PerasCertDiffusionOutbound blk m ()
- hPerasVoteDiffusionClient ∷ NodeToNodeVersion → ControlMessageSTM m → ConnectionId addr → PerasVoteDiffusionInboundPipelined blk m ()
- hPerasVoteDiffusionServer ∷ NodeToNodeVersion → ConnectionId addr → PerasVoteDiffusionOutbound blk m ()
- hKeepAliveClient ∷ NodeToNodeVersion → ControlMessageSTM m → ConnectionId addr → StrictTVar m (Map (ConnectionId addr) PeerGSV) → KeepAliveInterval → KeepAliveClient m ()
- hKeepAliveServer ∷ NodeToNodeVersion → ConnectionId addr → KeepAliveServer m ()
- hPeerSharingClient ∷ NodeToNodeVersion → ControlMessageSTM m → ConnectionId addr → PeerSharingController addr m → m (PeerSharingClient addr m ())
- hPeerSharingServer ∷ NodeToNodeVersion → ConnectionId addr → PeerSharingServer addr m
- hLeiosNotifyClient ∷ NodeToNodeVersion → ControlMessageSTM m → ConnectionId addr → StrictTVar m (LeiosNotifyPeerState blk) → LeiosNotifyClientPeerPipelined LeiosPoint (Header blk) LeiosVote m ()
- hLeiosNotifyServer ∷ NodeToNodeVersion → ConnectionId addr → m (LeiosNotifyServerPeerLookahead LeiosPoint (Header blk) LeiosVote m)
- mkHandlers ∷ ∀ (m ∷ Type → Type) blk addrNTN addrNTC. (IOLike m, MonadTime m, MonadTimer m, HasTxId (GenTx blk), BlockSupportsPeras blk, LedgerSupportsMempool blk, LedgerSupportsProtocol blk, LeiosProtocol (BlockProtocol blk), ConvertRawHash blk, HasHardForkHistory blk, Ord addrNTN, Hashable addrNTN) ⇒ NodeKernelArgs m addrNTN addrNTC blk → NodeKernel m addrNTN addrNTC blk → TxSubmissionLogicVersion → Handlers m addrNTN blk
- data Codecs blk addr e (m ∷ Type → Type) bCS bSCS bBF bSBF bTX bPCD bPVD bKA bPS bLN = 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
- cPerasCertDiffusionCodec ∷ Codec (PerasCertDiffusion blk) e m bPCD
- cPerasVoteDiffusionCodec ∷ Codec (PerasVoteDiffusion blk) e m bPVD
- cKeepAliveCodec ∷ Codec KeepAlive e m bKA
- cPeerSharingCodec ∷ Codec (PeerSharing addr) e m bPS
- cLeiosNotifyCodec ∷ Codec (LeiosNotify LeiosPoint (Header blk) LeiosVote) e m bLN
- defaultCodecs ∷ ∀ (m ∷ Type → Type) blk addr. (IOLike m, SerialiseNodeToNodeConstraints blk) ⇒ CodecConfig blk → BlockNodeToNodeVersion blk → (NodeToNodeVersion → addr → Encoding) → (NodeToNodeVersion → ∀ s. Decoder s addr) → NodeToNodeVersion → Codecs blk addr DeserialiseFailure m ByteString ByteString ByteString ByteString ByteString ByteString ByteString ByteString ByteString ByteString
- identityCodecs ∷ ∀ (m ∷ Type → Type) blk addr. Monad m ⇒ Codecs blk addr 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 (PerasCertDiffusion blk)) (AnyMessage (PerasVoteDiffusion blk)) (AnyMessage KeepAlive) (AnyMessage (PeerSharing addr)) (AnyMessage (LeiosNotify LeiosPoint (Header blk) LeiosVote))
- data ByteLimits bCS bBF bTX bPCD bPVD bKA bPS bLN
- byteLimits ∷ ByteLimits ByteString ByteString ByteString ByteString ByteString ByteString ByteString ByteString
- noByteLimits ∷ ByteLimits bCS bBF bTX bPCD bPVD bKA bPS bLN
- type Tracers (m ∷ Type → Type) ntnAddr blk e = Tracers' (ConnectionId ntnAddr) ntnAddr blk e (Tracer m)
- data Tracers' peer ntnAddr blk e (f ∷ Type → Type) = 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))))
- tPerasCertDiffusionTracer ∷ f (TraceLabelPeer peer (TraceSendRecv (PerasCertDiffusion blk)))
- tPerasVoteDiffusionTracer ∷ f (TraceLabelPeer peer (TraceSendRecv (PerasVoteDiffusion blk)))
- tKeepAliveTracer ∷ f (TraceLabelPeer peer (TraceSendRecv KeepAlive))
- tPeerSharingTracer ∷ f (TraceLabelPeer peer (TraceSendRecv (PeerSharing ntnAddr)))
- nullTracers ∷ ∀ (m ∷ Type → Type) ntnAddr blk e. Monad m ⇒ Tracers m ntnAddr blk e
- showTracers ∷ ∀ (m ∷ Type → Type) blk ntnAddr e. (Monad m, Show blk, Show ntnAddr, Show (Header blk), Show (GenTx blk), Show (GenTxId blk), Show (PerasVote blk), Show (PerasCert blk), HasHeader blk, HasNestedContent Header blk) ⇒ Tracer m String → Tracers m ntnAddr blk e
- data Apps (m ∷ Type → Type) addr bCS bBF bTX bPCD bPVD bKA bPS bLN a b = Apps {
- aChainSyncClient ∷ ClientApp m addr bCS a
- aChainSyncServer ∷ ServerApp m addr bCS b
- aBlockFetchClient ∷ ClientApp m addr bBF a
- aBlockFetchServer ∷ ServerApp m addr bBF b
- aTxSubmission2Client ∷ ClientApp m addr bTX a
- aTxSubmission2Server ∷ ServerApp m addr bTX b
- aPerasCertDiffusionClient ∷ ClientApp m addr bPCD a
- aPerasCertDiffusionServer ∷ ServerApp m addr bPCD b
- aPerasVoteDiffusionClient ∷ ClientApp m addr bPVD a
- aPerasVoteDiffusionServer ∷ ServerApp m addr bPVD b
- aKeepAliveClient ∷ ClientApp m addr bKA a
- aKeepAliveServer ∷ ServerApp m addr bKA b
- aPeerSharingClient ∷ ClientApp m addr bPS a
- aPeerSharingServer ∷ ServerApp m addr bPS b
- aLeiosNotifyClient ∷ ClientApp m addr bLN a
- aLeiosNotifyServer ∷ ServerApp m addr bLN b
- type ClientApp (m ∷ Type → Type) addr bytes a = NodeToNodeVersion → ExpandedInitiatorContext addr PeerTrustable m → Channel m bytes → m (a, Maybe bytes)
- type ServerApp (m ∷ Type → Type) addr bytes a = NodeToNodeVersion → ResponderContext addr → Channel m bytes → m (a, Maybe bytes)
- mkApps ∷ ∀ (m ∷ Type → Type) addrNTN addrNTC blk e bCS bBF bTX bPCD bPVD bKA bPS bLN. (IOLike m, MonadTimer m, Ord addrNTN, Exception e, NFData e, LedgerSupportsProtocol blk, BlockSupportsPeras blk, ShowProxy blk, ShowProxy (Header blk), ShowProxy (TxId (GenTx blk)), ShowProxy (GenTx blk), ShowProxy (PerasVote blk), ShowProxy (PerasCert blk), Show addrNTN, LedgerSupportsMempool blk, HasTxId (GenTx blk), HasRawTxId (GenTxId blk)) ⇒ NodeKernel m addrNTN addrNTC blk → StdGen → Tracers m addrNTN blk e → (NodeToNodeVersion → Codecs blk addrNTN e m bCS bCS bBF bBF bTX bPCD bPVD bKA bPS bLN) → ByteLimits bCS bBF bTX bPCD bPVD bKA bPS bLN → (∀ header. PeerTrustable → ProtocolTimeLimitsWithRnd (ChainSync header (Point blk) (Tip blk))) → ChainSyncLoPBucketConfig → CSJConfig → ReportPeerMetrics m (ConnectionId addrNTN) → Handlers m addrNTN blk → Apps m addrNTN bCS bBF bTX bPCD bPVD bKA bPS bLN NodeToNodeInitiatorResult ()
- initiator ∷ ∀ (m ∷ Type → Type) addr b a c. Set CardanoFeatureFlag → MiniProtocolParameters → NodeToNodeVersion → NodeToNodeVersionData → Apps m addr b b b b b b b b a c → OuroborosBundleWithExpandedCtx 'InitiatorMode addr PeerTrustable b m a Void
- initiatorAndResponder ∷ ∀ (m ∷ Type → Type) addr b a c. Set CardanoFeatureFlag → MiniProtocolParameters → NodeToNodeVersion → NodeToNodeVersionData → Apps m addr b b b b b b b b a c → OuroborosBundleWithExpandedCtx 'InitiatorResponderMode addr PeerTrustable b m a c
Handlers
data Handlers (m ∷ Type → Type) addr blk Source #
Protocol handlers for node-to-node (remote) communication
Constructors
mkHandlers ∷ ∀ (m ∷ Type → Type) blk addrNTN addrNTC. (IOLike m, MonadTime m, MonadTimer m, HasTxId (GenTx blk), BlockSupportsPeras blk, LedgerSupportsMempool blk, LedgerSupportsProtocol blk, LeiosProtocol (BlockProtocol blk), ConvertRawHash blk, HasHardForkHistory blk, Ord addrNTN, Hashable addrNTN) ⇒ NodeKernelArgs m addrNTN addrNTC blk → NodeKernel m addrNTN addrNTC blk → TxSubmissionLogicVersion → Handlers m addrNTN blk Source #
Codecs
data Codecs blk addr e (m ∷ Type → Type) bCS bSCS bBF bSBF bTX bPCD bPVD bKA bPS bLN Source #
Node-to-node protocol codecs needed to run Handlers.
Constructors
| Codecs | |
Fields
| |
defaultCodecs ∷ ∀ (m ∷ Type → Type) blk addr. (IOLike m, SerialiseNodeToNodeConstraints blk) ⇒ CodecConfig blk → BlockNodeToNodeVersion blk → (NodeToNodeVersion → addr → Encoding) → (NodeToNodeVersion → ∀ s. Decoder s addr) → NodeToNodeVersion → Codecs blk addr DeserialiseFailure m ByteString ByteString ByteString ByteString ByteString ByteString ByteString ByteString ByteString ByteString Source #
Protocol codecs for the node-to-node protocols
identityCodecs ∷ ∀ (m ∷ Type → Type) blk addr. Monad m ⇒ Codecs blk addr 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 (PerasCertDiffusion blk)) (AnyMessage (PerasVoteDiffusion blk)) (AnyMessage KeepAlive) (AnyMessage (PeerSharing addr)) (AnyMessage (LeiosNotify LeiosPoint (Header blk) LeiosVote)) Source #
Identity codecs used in tests.
Byte Limits
data ByteLimits bCS bBF bTX bPCD bPVD bKA bPS bLN 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.
byteLimits ∷ ByteLimits ByteString ByteString ByteString ByteString ByteString ByteString ByteString ByteString Source #
noByteLimits ∷ ByteLimits bCS bBF bTX bPCD bPVD bKA bPS bLN Source #
Tracers
type Tracers (m ∷ Type → Type) ntnAddr blk e = Tracers' (ConnectionId ntnAddr) ntnAddr blk e (Tracer m) Source #
A record of Tracers for the different protocols.
data Tracers' peer ntnAddr blk e (f ∷ Type → Type) Source #
Constructors
| Tracers | |
Fields
| |
nullTracers ∷ ∀ (m ∷ Type → Type) ntnAddr blk e. Monad m ⇒ Tracers m ntnAddr blk e Source #
Use a nullTracer for each protocol.
showTracers ∷ ∀ (m ∷ Type → Type) blk ntnAddr e. (Monad m, Show blk, Show ntnAddr, Show (Header blk), Show (GenTx blk), Show (GenTxId blk), Show (PerasVote blk), Show (PerasCert blk), HasHeader blk, HasNestedContent Header blk) ⇒ Tracer m String → Tracers m ntnAddr blk e Source #
Applications
data Apps (m ∷ Type → Type) addr bCS bBF bTX bPCD bPVD bKA bPS bLN a b Source #
Applications for the node-to-node protocols
See MuxApplication
Constructors
| Apps | |
Fields
| |
type ClientApp (m ∷ Type → Type) addr bytes a = NodeToNodeVersion → ExpandedInitiatorContext addr PeerTrustable m → Channel m bytes → m (a, Maybe bytes) Source #
A node-to-node application
type ServerApp (m ∷ Type → Type) addr bytes a = NodeToNodeVersion → ResponderContext addr → Channel m bytes → m (a, Maybe bytes) Source #
Arguments
| ∷ ∀ (m ∷ Type → Type) addrNTN addrNTC blk e bCS bBF bTX bPCD bPVD bKA bPS bLN. (IOLike m, MonadTimer m, Ord addrNTN, Exception e, NFData e, LedgerSupportsProtocol blk, BlockSupportsPeras blk, ShowProxy blk, ShowProxy (Header blk), ShowProxy (TxId (GenTx blk)), ShowProxy (GenTx blk), ShowProxy (PerasVote blk), ShowProxy (PerasCert blk), Show addrNTN, LedgerSupportsMempool blk, HasTxId (GenTx blk), HasRawTxId (GenTxId blk)) | |
| ⇒ NodeKernel m addrNTN addrNTC blk | Needed for bracketing only |
| → StdGen | |
| → Tracers m addrNTN blk e | |
| → (NodeToNodeVersion → Codecs blk addrNTN e m bCS bCS bBF bBF bTX bPCD bPVD bKA bPS bLN) | |
| → ByteLimits bCS bBF bTX bPCD bPVD bKA bPS bLN | |
| → (∀ header. PeerTrustable → ProtocolTimeLimitsWithRnd (ChainSync header (Point blk) (Tip blk))) | |
| → ChainSyncLoPBucketConfig | |
| → CSJConfig | |
| → ReportPeerMetrics m (ConnectionId addrNTN) | |
| → Handlers m addrNTN blk | |
| → Apps m addrNTN bCS bBF bTX bPCD bPVD bKA bPS bLN NodeToNodeInitiatorResult () |
Construct the NetworkApplication for the node-to-node protocols
Projections
initiator ∷ ∀ (m ∷ Type → Type) addr b a c. Set CardanoFeatureFlag → MiniProtocolParameters → NodeToNodeVersion → NodeToNodeVersionData → Apps m addr b b b b b b b b a c → OuroborosBundleWithExpandedCtx 'InitiatorMode addr PeerTrustable 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 ∷ ∀ (m ∷ Type → Type) addr b a c. Set CardanoFeatureFlag → MiniProtocolParameters → NodeToNodeVersion → NodeToNodeVersionData → Apps m addr b b b b b b b b a c → OuroborosBundleWithExpandedCtx 'InitiatorResponderMode addr PeerTrustable b m a c Source #
A bi-directional network application.
Implementation note: network currently doesn't enable protocols conditional
on the protocol version, but it eventually may; this is why _version is
currently unused.