ouroboros-consensus-diffusion-0.16.0.0: Integration for the Ouroboros Network layer
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Consensus.Network.NodeToNode

Description

Intended for qualified import

Synopsis

Handlers

data Handlers m addr blk Source #

Protocol handlers for node-to-node (remote) communication

mkHandlers ∷ ∀ m blk addrNTN addrNTC. (IOLike m, MonadTime m, MonadTimer m, LedgerSupportsMempool blk, HasTxId (GenTx blk), LedgerSupportsProtocol blk, Ord addrNTN, Hashable addrNTN) ⇒ NodeKernelArgs m addrNTN addrNTC blk → NodeKernel m addrNTN addrNTC blk → Handlers m addrNTN blk Source #

Codecs

data Codecs blk addr e m bCS bSCS bBF bSBF bTX bKA bPS Source #

Node-to-node protocol codecs needed to run Handlers.

Constructors

Codecs 

Fields

defaultCodecs ∷ ∀ m blk addr. (IOLike m, SerialiseNodeToNodeConstraints blk) ⇒ CodecConfig blk → BlockNodeToNodeVersion blk → (NodeToNodeVersion → addr → Encoding) → (NodeToNodeVersion → ∀ s. Decoder s addr) → NodeToNodeVersionCodecs blk addr DeserialiseFailure m ByteString ByteString ByteString ByteString ByteString ByteString ByteString Source #

Protocol codecs for the node-to-node protocols

identityCodecsMonad 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 KeepAlive) (AnyMessage (PeerSharing addr)) 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.

noByteLimitsByteLimits bCS bBF bTX bKA Source #

Tracers

type Tracers m peer blk e = Tracers' peer blk e (Tracer m) Source #

A record of Tracers for the different protocols.

data Tracers' peer blk e f Source #

Instances

Instances details
(∀ a. Semigroup (f a)) ⇒ Semigroup (Tracers' peer blk e f) Source # 
Instance details

Defined in Ouroboros.Consensus.Network.NodeToNode

Methods

(<>)Tracers' peer blk e f → Tracers' peer blk e f → Tracers' peer blk e f #

sconcatNonEmpty (Tracers' peer blk e f) → Tracers' peer blk e f #

stimesIntegral b ⇒ b → Tracers' peer blk e f → Tracers' peer blk e f #

nullTracersMonad 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 StringTracers m peer blk e Source #

Applications

data Apps m addr bCS bBF bTX bKA bPS a b Source #

Applications for the node-to-node protocols

See MuxApplication

Constructors

Apps 

Fields

type ClientApp m addr bytes a = NodeToNodeVersionExpandedInitiatorContext addr m → Channel m bytes → m (a, Maybe bytes) Source #

A node-to-node application

type ServerApp m addr bytes a = NodeToNodeVersionResponderContext addr → Channel m bytes → m (a, Maybe bytes) Source #

mkApps Source #

Arguments

∷ ∀ m addrNTN addrNTC blk e bCS bBF bTX bKA bPS. (IOLike m, MonadTimer m, Ord addrNTN, Exception e, LedgerSupportsProtocol blk, ShowProxy blk, ShowProxy (Header blk), ShowProxy (TxId (GenTx blk)), ShowProxy (GenTx blk)) 
NodeKernel m addrNTN addrNTC blk

Needed for bracketing only

Tracers m (ConnectionId addrNTN) blk e 
→ (NodeToNodeVersionCodecs blk addrNTN e m bCS bCS bBF bBF bTX bKA bPS) 
ByteLimits bCS bBF bTX bKA 
→ m ChainSyncTimeout 
ChainSyncLoPBucketConfig 
ReportPeerMetrics m (ConnectionId addrNTN) 
Handlers m addrNTN blk 
Apps m addrNTN bCS bBF bTX bKA bPS NodeToNodeInitiatorResult () 

Construct the NetworkApplication for the node-to-node protocols

Projections

initiatorMiniProtocolParametersNodeToNodeVersionPeerSharingApps m addr b b b b b a c → OuroborosBundleWithExpandedCtx 'InitiatorMode addr 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.

initiatorAndResponderMiniProtocolParametersNodeToNodeVersionPeerSharingApps m addr b b b b b a c → OuroborosBundleWithExpandedCtx 'InitiatorResponderMode addr 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.

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 intersectmbo/ouroboros-network#2245.)