ouroboros-network-0.10.1.0: A networking layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Network.Diffusion.P2P

Description

This module is expected to be imported qualified (it will clash with the Ouroboros.Network.Diffusion.NonP2P).

Synopsis

Documentation

data TracersExtra ntnAddr ntnVersion ntnVersionData ntcAddr ntcVersion ntcVersionData resolverError m Source #

P2P DiffusionTracers Extras

Constructors

TracersExtra 

Fields

nullTracers :: Applicative m => TracersExtra ntnAddr ntnVersion ntnVersionData ntcAddr ntcVersion ntcVersionData resolverError m Source #

data ArgumentsExtra m Source #

P2P Arguments Extras

Constructors

ArgumentsExtra 

Fields

  • daPeerSelectionTargets :: PeerSelectionTargets

    selection targets for the peer governor

  • daReadLocalRootPeers :: STM m [(HotValency, WarmValency, Map RelayAccessPoint PeerAdvertise)]
     
  • daReadPublicRootPeers :: STM m (Map RelayAccessPoint PeerAdvertise)
     
  • daOwnPeerSharing :: PeerSharing

    Peer's own PeerSharing value.

    This value comes from the node's configuration file and is static.

  • daReadUseLedgerAfter :: STM m UseLedgerAfter
     
  • daProtocolIdleTimeout :: DiffTime

    Timeout which starts once all responder protocols are idle. If the responders stay idle for duration of the timeout, the connection will be demoted, if it wasn't used by the p2p-governor it will be closed.

    Applies to Unidirectional as well as Duplex node-to-node connections.

    See serverProtocolIdleTimeout.

  • daTimeWaitTimeout :: DiffTime

    Time for which node-to-node connections are kept in TerminatingState, it should correspond to the OS configured TCP TIME_WAIT timeout.

    This timeout will apply to after a connection has been closed, its purpose is to be resilient for delayed packets in the same way TCP is using TIME_WAIT.

  • daDeadlineChurnInterval :: DiffTime

    Churn interval between churn events in deadline mode. A small fuzz is added (max 10 minutes) so that not all nodes churn at the same time.

    By default it is set to 3300 seconds.

  • daBulkChurnInterval :: DiffTime

    Churn interval between churn events in bulk sync mode. A small fuzz is added (max 1 minute) so that not all nodes churn at the same time.

    By default it is set to 300 seconds.

data ApplicationsExtra ntnAddr m a Source #

P2P Applications Extras

TODO: we need initiator only mode for Daedalus, there's no reason why it should run a node-to-node server side.

Constructors

ApplicationsExtra 

Fields

run :: Tracers RemoteAddress NodeToNodeVersion LocalAddress NodeToClientVersion IO -> TracersExtra RemoteAddress NodeToNodeVersion NodeToNodeVersionData LocalAddress NodeToClientVersion NodeToClientVersionData IOException IO -> Arguments Socket RemoteAddress LocalSocket LocalAddress -> ArgumentsExtra IO -> Applications RemoteAddress NodeToNodeVersion NodeToNodeVersionData LocalAddress NodeToClientVersion NodeToClientVersionData IO a -> ApplicationsExtra RemoteAddress IO a -> IO Void Source #

Main entry point for data diffusion service. It allows to:

  • connect to upstream peers;
  • accept connection from downstream peers, if run in InitiatorAndResponderDiffusionMode.
  • runs a local service which allows to use node-to-client protocol to obtain information from the running system. This is used by 'cardano-cli' or a wallet and a like local services.

data Interfaces ntnFd ntnAddr ntnVersion ntnVersionData ntcFd ntcAddr ntcVersion ntcVersionData resolver resolverError m Source #

Constructors

Interfaces 

Fields

  • diNtnSnocket :: Snocket m ntnFd ntnAddr

    node-to-node snocket

  • diNtnBearer :: MakeBearer m ntnFd

    node-to-node MakeBearer callback

  • diNtnConfigureSocket :: ntnFd -> Maybe ntnAddr -> m ()

    node-to-node socket configuration

  • diNtnConfigureSystemdSocket :: ntnFd -> ntnAddr -> m ()

    node-to-node systemd socket configuration

  • diNtnHandshakeArguments :: HandshakeArguments (ConnectionId ntnAddr) ntnVersion ntnVersionData m

    node-to-node handshake configuration

  • diNtnAddressType :: ntnAddr -> Maybe AddressType

    node-to-node address type

  • diNtnDataFlow :: ntnVersion -> ntnVersionData -> DataFlow

    node-to-node data flow used by connection manager to classify negotiated connections

  • diNtnPeerSharing :: ntnVersionData -> PeerSharing

    remote side peer sharing information used by peer selection governor to decide which peers are available for performing peer sharing

  • diNtnToPeerAddr :: IP -> PortNumber -> ntnAddr

    node-to-node peer address

  • diNtcSnocket :: Snocket m ntcFd ntcAddr

    node-to-client snocket

  • diNtcBearer :: MakeBearer m ntcFd

    node-to-client MakeBearer callback

  • diNtcHandshakeArguments :: HandshakeArguments (ConnectionId ntcAddr) ntcVersion ntcVersionData m

    node-to-client handshake configuration

  • diNtcGetFileDescriptor :: ntcFd -> m FileDescriptor

    node-to-client file descriptor

  • diRng :: StdGen

    diffusion pseudo random generator. It is split between various components that need randomness, e.g. inbound governor, peer selection, policies, etc.

  • diInstallSigUSR1Handler :: forall mode x y. NodeToNodeConnectionManager mode ntnFd ntnAddr ntnVersionData ntnVersion m x y -> m ()

    callback which is used to register SIGUSR1 signal handler.

  • diDnsActions :: DNSLookupType -> DNSActions resolver resolverError m

    diffusion dns actions

runM Source #

Arguments

:: forall m ntnFd ntnAddr ntnVersion ntnVersionData ntcFd ntcAddr ntcVersion ntcVersionData resolver resolverError a. (Alternative (STM m), MonadAsync m, MonadDelay m, MonadEvaluate m, MonadFix m, MonadFork m, MonadLabelledSTM m, MonadTraceSTM m, MonadMask m, MonadThrow (STM m), MonadTime m, MonadTimer m, MonadMVar m, Typeable ntnAddr, Ord ntnAddr, Show ntnAddr, Typeable ntnVersion, Ord ntnVersion, Show ntnVersion, Show ntnVersionData, Typeable ntcAddr, Ord ntcAddr, Show ntcAddr, Ord ntcVersion, Exception resolverError) 
=> Interfaces ntnFd ntnAddr ntnVersion ntnVersionData ntcFd ntcAddr ntcVersion ntcVersionData resolver resolverError m

interfaces

-> Tracers ntnAddr ntnVersion ntcAddr ntcVersion m

tracers

-> TracersExtra ntnAddr ntnVersion ntnVersionData ntcAddr ntcVersion ntcVersionData resolverError m

p2p tracers

-> Arguments ntnFd ntnAddr ntcFd ntcAddr

configuration

-> ArgumentsExtra m

p2p configuration

-> Applications ntnAddr ntnVersion ntnVersionData ntcAddr ntcVersion ntcVersionData m a

protocol handlers

-> ApplicationsExtra ntnAddr m a

p2p protocol handlers

-> m Void 

type NodeToNodePeerConnectionHandle (mode :: MuxMode) ntnAddr ntnVersionData m a b = PeerConnectionHandle mode (ResponderContext ntnAddr) ntnAddr ntnVersionData ByteString m a b Source #

type AbstractTransitionTrace peerAddr = TransitionTrace' peerAddr AbstractState #

type RemoteTransitionTrace peerAddr = TransitionTrace' peerAddr (Maybe RemoteSt) #