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

data Handlers m peer blk Source #

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

Constructors

Handlers 

Fields

mkHandlers :: forall m blk remotePeer localPeer. (IOLike m, MonadTimer m, LedgerSupportsMempool blk, HasTxId (GenTx blk), LedgerSupportsProtocol blk, Ord remotePeer) => NodeArgs 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

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 (TxSubmission (GenTxId blk) (GenTx blk))) (AnyMessage KeepAlive) Source #

Identity codecs used in tests.

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 #

Constructors

Tracers 

Fields

Instances

Instances details
(forall 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 #

sconcat :: NonEmpty (Tracers' peer blk e f) -> Tracers' peer blk e f #

stimes :: Integral b => b -> Tracers' peer blk e f -> Tracers' peer blk e f #

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

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 #

data Apps m peer bCS bBF bTX bKA a Source #

Applications for the node-to-node protocols

See MuxApplication

Constructors

Apps 

Fields

mkApps Source #

Arguments

:: 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 
-> Codecs blk e m bCS bCS bBF bBF bTX bKA 
-> m ChainSyncTimeout 
-> 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 -> OuroborosApplication '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.

responder :: MiniProtocolParameters -> NodeToNodeVersion -> Apps m (ConnectionId peer) b b b b a -> OuroborosApplication 'ResponderMode peer b m Void a Source #

A projection from NetworkApplication to a server-side OuroborosApplication for the node-to-node protocols.

See initiatorNetworkApplication for rationale for the _version arg.

Re-exports