ouroboros-network-framework
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.InboundGovernor

Description

Server implementation based on ConnectionManager

Synopsis

Run Inbound Protocol Governor

data PublicInboundGovernorState peerAddr versionData Source #

Public inbound governor state.

Constructors

PublicInboundGovernorState 

Fields

withInboundGovernor :: forall (muxMode :: MuxMode) socket initiatorCtx peerAddr versionData versionNumber m a b x. (Alternative (STM m), MonadAsync m, MonadCatch m, MonadEvaluate m, MonadLabelledSTM m, MonadThrow m, MonadThrow (STM m), MonadTime m, MonadTimer m, MonadMask m, Ord peerAddr, HasResponder muxMode ~ 'True) => Tracer m (RemoteTransitionTrace peerAddr) -> Tracer m (InboundGovernorTrace peerAddr) -> Tracer m (DebugInboundGovernor peerAddr) -> InboundGovernorInfoChannel muxMode initiatorCtx peerAddr versionData ByteString m a b -> Maybe DiffTime -> MuxConnectionManager muxMode socket initiatorCtx (ResponderContext peerAddr) peerAddr versionData versionNumber ByteString m a b -> (Async m Void -> m (PublicInboundGovernorState peerAddr versionData) -> m x) -> m x Source #

Run the server, which consists of the following components:

  • inbound governor, it corresponds to p2p-governor on outbound side
  • accept loop(s), one per given ip address. We support up to one ipv4 address and up to one ipv6 address, i.e. an ipv6 enabled node will run two accept loops on listening on different addresses with shared inbound governor.

The server can be run in either of two MuxMode-es:

The first one is used in data diffusion for Node-To-Node protocol, while the other is useful for running a server for the Node-To-Client protocol.

Trace

data InboundGovernorTrace peerAddr Source #

Instances

Instances details
Show peerAddr => Show (InboundGovernorTrace peerAddr) Source # 
Instance details

Defined in Ouroboros.Network.InboundGovernor

data DebugInboundGovernor peerAddr Source #

Constructors

DebugInboundGovernor (InboundGovernorState muxMode initiatorCtx peerAddr versionData m a b) 

data RemoteSt Source #

Remote connection state tracked by inbound protocol governor.

This type is used for tracing.

Instances

Instances details
Show RemoteSt Source # 
Instance details

Defined in Ouroboros.Network.InboundGovernor.State

Eq RemoteSt Source # 
Instance details

Defined in Ouroboros.Network.InboundGovernor.State

type RemoteTransition = Transition' (Maybe RemoteSt) Source #

Nothing represents uninitialised state.

data AcceptConnectionsPolicyTrace Source #

Trace for the AcceptConnectionsLimit policy.

Re-exports

data Transition' state Source #

Constructors

Transition 

Fields

Instances

Instances details
Functor Transition' Source # 
Instance details

Defined in Ouroboros.Network.ConnectionManager.Types

Methods

fmap :: (a -> b) -> Transition' a -> Transition' b #

(<$) :: a -> Transition' b -> Transition' a #

Show state => Show (Transition' state) Source # 
Instance details

Defined in Ouroboros.Network.ConnectionManager.Types

Methods

showsPrec :: Int -> Transition' state -> ShowS #

show :: Transition' state -> String #

showList :: [Transition' state] -> ShowS #

Eq state => Eq (Transition' state) Source # 
Instance details

Defined in Ouroboros.Network.ConnectionManager.Types

Methods

(==) :: Transition' state -> Transition' state -> Bool #

(/=) :: Transition' state -> Transition' state -> Bool #

data TransitionTrace' peerAddr state Source #

Constructors

TransitionTrace 

Fields

Instances

Instances details
Functor (TransitionTrace' peerAddr) Source # 
Instance details

Defined in Ouroboros.Network.ConnectionManager.Types

Methods

fmap :: (a -> b) -> TransitionTrace' peerAddr a -> TransitionTrace' peerAddr b #

(<$) :: a -> TransitionTrace' peerAddr b -> TransitionTrace' peerAddr a #

(Show peerAddr, Show state) => Show (TransitionTrace' peerAddr state) Source # 
Instance details

Defined in Ouroboros.Network.ConnectionManager.Types

Methods

showsPrec :: Int -> TransitionTrace' peerAddr state -> ShowS #

show :: TransitionTrace' peerAddr state -> String #

showList :: [TransitionTrace' peerAddr state] -> ShowS #

API's exported for testing purposes

maturedPeers :: Ord peerAddr => Time -> OrdPSQ peerAddr Time versionData -> (Map peerAddr versionData, OrdPSQ peerAddr Time versionData) Source #