Safe Haskell | None |
---|---|
Language | Haskell2010 |
Server implementation based on
ConnectionManager
Synopsis
- newtype InboundGovernorObservableState = InboundGovernorObservableState { }
- newObservableStateVar :: MonadLabelledSTM m => StdGen -> m ( StrictTVar m InboundGovernorObservableState )
- newObservableStateVarIO :: IO ( StrictTVar IO InboundGovernorObservableState )
- newObservableStateVarFromSeed :: MonadLabelledSTM m => Int -> m ( StrictTVar m InboundGovernorObservableState )
- inboundGovernor :: forall (muxMode :: MuxMode ) socket peerAddr versionNumber m a b. ( MonadAsync m, MonadCatch m, MonadEvaluate 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) -> ServerControlChannel muxMode peerAddr ByteString m a b -> DiffTime -> MuxConnectionManager muxMode socket peerAddr versionNumber ByteString m a b -> StrictTVar m InboundGovernorObservableState -> m Void
-
data
InboundGovernorTrace
peerAddr
- = TrNewConnection ! Provenance !( ConnectionId peerAddr)
- | TrResponderRestarted !( ConnectionId peerAddr) ! MiniProtocolNum
- | TrResponderStartFailure !( ConnectionId peerAddr) ! MiniProtocolNum ! SomeException
- | TrResponderErrored !( ConnectionId peerAddr) ! MiniProtocolNum ! SomeException
- | TrResponderStarted !( ConnectionId peerAddr) ! MiniProtocolNum
- | TrResponderTerminated !( ConnectionId peerAddr) ! MiniProtocolNum
- | TrPromotedToWarmRemote !( ConnectionId peerAddr) !( OperationResult AbstractState )
- | TrPromotedToHotRemote !( ConnectionId peerAddr)
- | TrDemotedToWarmRemote !( ConnectionId peerAddr)
- | TrDemotedToColdRemote !( ConnectionId peerAddr) !( OperationResult DemotedToColdRemoteTr )
- | TrWaitIdleRemote !( ConnectionId peerAddr) !( OperationResult AbstractState )
- | TrMuxCleanExit !( ConnectionId peerAddr)
- | TrMuxErrored !( ConnectionId peerAddr) SomeException
- | TrInboundGovernorCounters ! InboundGovernorCounters
- | TrRemoteState !( Map ( ConnectionId peerAddr) RemoteSt )
- | TrUnexpectedlyFalseAssertion !(IGAssertionLocation peerAddr)
- | TrInboundGovernorError ! SomeException
- data RemoteSt
- type RemoteTransition = Transition' ( Maybe RemoteSt )
- type RemoteTransitionTrace peerAddr = TransitionTrace' peerAddr ( Maybe RemoteSt )
- data AcceptConnectionsPolicyTrace
- data Transition' state = Transition { }
-
data
TransitionTrace'
peerAddr state =
TransitionTrace
{
- ttPeerAddr :: peerAddr
- ttTransition :: Transition' state
Documentation
newtype InboundGovernorObservableState Source #
Currently only
StdGen
, but in the future this will be extended to
a record which contains some useful statistics about peers to support more
advances prune strategies (see.
PruneStrategy
).
newObservableStateVar :: MonadLabelledSTM m => StdGen -> m ( StrictTVar m InboundGovernorObservableState ) Source #
Create new observable state
StrictTVar
.
newObservableStateVarIO :: IO ( StrictTVar IO InboundGovernorObservableState ) Source #
Using the global
StdGen
.
newObservableStateVarFromSeed :: MonadLabelledSTM m => Int -> m ( StrictTVar m InboundGovernorObservableState ) Source #
Useful for testing, it is using
mkStdGen
.
Run Inbound Protocol Governor
inboundGovernor :: forall (muxMode :: MuxMode ) socket peerAddr versionNumber m a b. ( MonadAsync m, MonadCatch m, MonadEvaluate 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) -> ServerControlChannel muxMode peerAddr ByteString m a b -> DiffTime -> MuxConnectionManager muxMode socket peerAddr versionNumber ByteString m a b -> StrictTVar m InboundGovernorObservableState -> m Void 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
Show peerAddr => Show ( InboundGovernorTrace peerAddr) Source # | |
Defined in Ouroboros.Network.InboundGovernor |
Remote connection state tracked by inbound protocol governor.
type RemoteTransition = Transition' ( Maybe RemoteSt ) Source #
Nothing
represents unitialised state.
type RemoteTransitionTrace peerAddr = TransitionTrace' peerAddr ( Maybe RemoteSt ) Source #
data AcceptConnectionsPolicyTrace Source #
Trace for the
AcceptConnectionsLimit
policy.
ServerTraceAcceptConnectionRateLimiting DiffTime Int | |
ServerTraceAcceptConnectionHardLimit Word32 | |
ServerTraceAcceptConnectionResume Int |
Instances
Re-exports
data Transition' state Source #
Instances
Functor Transition' Source # | |
Defined in Ouroboros.Network.ConnectionManager.Types fmap :: (a -> b) -> Transition' a -> Transition' b Source # (<$) :: a -> Transition' b -> Transition' a Source # |
|
Eq state => Eq ( Transition' state) Source # | |
Defined in Ouroboros.Network.ConnectionManager.Types (==) :: Transition' state -> Transition' state -> Bool Source # (/=) :: Transition' state -> Transition' state -> Bool Source # |
|
Show state => Show ( Transition' state) Source # | |
Defined in Ouroboros.Network.ConnectionManager.Types |
data TransitionTrace' peerAddr state Source #
TransitionTrace | |
|
Instances
Functor ( TransitionTrace' peerAddr) Source # | |
Defined in Ouroboros.Network.ConnectionManager.Types fmap :: (a -> b) -> TransitionTrace' peerAddr a -> TransitionTrace' peerAddr b Source # (<$) :: a -> TransitionTrace' peerAddr b -> TransitionTrace' peerAddr a Source # |
|
( Show peerAddr, Show state) => Show ( TransitionTrace' peerAddr state) Source # | |
Defined in Ouroboros.Network.ConnectionManager.Types |