ouroboros-consensus-0.1.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Network.NodeToNode

Description

Intended for qualified import

Synopsis

Handlers

mkHandlers ∷ ∀ 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.

Constructors

Codecs 

Fields

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

Protocol codecs for the node-to-node protocols

identityCodecsMonad 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.

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 Source #

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

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

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 peer bCS bBF bTX bKA a Source #

Applications for the node-to-node protocols

See MuxApplication

Constructors

Apps 

Fields

type ClientApp m peer bytes a = NodeToNodeVersionControlMessageSTM 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 #

mkApps Source #

Arguments

∷ ∀ 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 
→ (NodeToNodeVersionCodecs 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

initiatorMiniProtocolParametersNodeToNodeVersionApps 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.

initiatorAndResponderMiniProtocolParametersNodeToNodeVersionApps 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.)