Safe Haskell | None |
---|---|
Language | Haskell2010 |
This is the starting point for a module that will bring together the overall node to node protocol, as a collection of mini-protocols.
Synopsis
- nodeToNodeProtocols :: MiniProtocolParameters -> ( ConnectionId addr -> STM m ControlMessage -> NodeToNodeProtocols muxMode bytes m a b) -> NodeToNodeVersion -> OuroborosBundle muxMode addr bytes m a b
-
data
NodeToNodeProtocols
appType bytes m a b =
NodeToNodeProtocols
{
- chainSyncProtocol :: RunMiniProtocol appType bytes m a b
- blockFetchProtocol :: RunMiniProtocol appType bytes m a b
- txSubmissionProtocol :: RunMiniProtocol appType bytes m a b
- keepAliveProtocol :: RunMiniProtocol appType bytes m a b
- data MiniProtocolParameters = MiniProtocolParameters { }
- chainSyncProtocolLimits :: MiniProtocolParameters -> MiniProtocolLimits
- blockFetchProtocolLimits :: MiniProtocolParameters -> MiniProtocolLimits
- txSubmissionProtocolLimits :: MiniProtocolParameters -> MiniProtocolLimits
- keepAliveProtocolLimits :: MiniProtocolParameters -> MiniProtocolLimits
- defaultMiniProtocolParameters :: MiniProtocolParameters
- data NodeToNodeVersion
-
data
NodeToNodeVersionData
=
NodeToNodeVersionData
{
- networkMagic :: ! NetworkMagic
- diffusionMode :: ! DiffusionMode
-
data
NetworkConnectTracers
addr vNumber =
NetworkConnectTracers
{
- nctMuxTracer :: Tracer IO ( WithMuxBearer ( ConnectionId addr) MuxTrace )
- nctHandshakeTracer :: Tracer IO ( WithMuxBearer ( ConnectionId addr) ( TraceSendRecv ( Handshake vNumber Term )))
- nullNetworkConnectTracers :: NetworkConnectTracers addr vNumber
- connectTo :: Snocket IO Socket SockAddr -> NetworkConnectTracers SockAddr NodeToNodeVersion -> Versions NodeToNodeVersion NodeToNodeVersionData ( OuroborosApplication InitiatorMode SockAddr ByteString IO a b) -> Maybe SockAddr -> SockAddr -> IO ()
-
data
NetworkServerTracers
addr vNumber =
NetworkServerTracers
{
- nstMuxTracer :: Tracer IO ( WithMuxBearer ( ConnectionId addr) MuxTrace )
- nstHandshakeTracer :: Tracer IO ( WithMuxBearer ( ConnectionId addr) ( TraceSendRecv ( Handshake vNumber Term )))
- nstErrorPolicyTracer :: Tracer IO ( WithAddr addr ErrorPolicyTrace )
- nstAcceptPolicyTracer :: Tracer IO AcceptConnectionsPolicyTrace
- nullNetworkServerTracers :: NetworkServerTracers addr vNumber
-
data
NetworkMutableState
addr =
NetworkMutableState
{
- nmsConnectionTable :: ConnectionTable IO addr
- nmsPeerStates :: StrictTVar IO ( PeerStates IO addr)
- data AcceptedConnectionsLimit = AcceptedConnectionsLimit { }
- newNetworkMutableState :: IO ( NetworkMutableState addr)
- newNetworkMutableStateSTM :: STM ( NetworkMutableState addr)
- cleanNetworkMutableState :: NetworkMutableState addr -> IO ()
- withServer :: SocketSnocket -> NetworkServerTracers SockAddr NodeToNodeVersion -> NetworkMutableState SockAddr -> AcceptedConnectionsLimit -> Socket -> Versions NodeToNodeVersion NodeToNodeVersionData ( OuroborosApplication ResponderMode SockAddr ByteString IO a b) -> ErrorPolicies -> IO Void
-
data
DomainAccessPoint
=
DomainAccessPoint
{
- dapDomain :: ! Domain
- dapPortNumber :: ! PortNumber
- data PeerAdvertise
- data PeerSelectionTargets = PeerSelectionTargets { }
-
data
IPSubscriptionTarget
=
IPSubscriptionTarget
{
- ispIps :: ![ SockAddr ]
- ispValency :: ! Int
- type NetworkIPSubscriptionTracers addr vNumber = NetworkSubscriptionTracers WithIPList addr vNumber
-
data
NetworkSubscriptionTracers
withIPList addr vNumber =
NetworkSubscriptionTracers
{
- nsMuxTracer :: Tracer IO ( WithMuxBearer ( ConnectionId addr) MuxTrace )
- nsHandshakeTracer :: Tracer IO ( WithMuxBearer ( ConnectionId addr) ( TraceSendRecv ( Handshake vNumber Term )))
- nsErrorPolicyTracer :: Tracer IO ( WithAddr addr ErrorPolicyTrace )
- nsSubscriptionTracer :: Tracer IO (withIPList ( SubscriptionTrace addr))
- nullNetworkSubscriptionTracers :: NetworkSubscriptionTracers withIPList addr vNumber
- data SubscriptionParams a target = SubscriptionParams { }
- type IPSubscriptionParams a = SubscriptionParams a IPSubscriptionTarget
- ipSubscriptionWorker :: forall mode x y. HasInitiator mode ~ True => SocketSnocket -> NetworkIPSubscriptionTracers SockAddr NodeToNodeVersion -> NetworkMutableState SockAddr -> IPSubscriptionParams () -> Versions NodeToNodeVersion NodeToNodeVersionData ( OuroborosApplication mode SockAddr ByteString IO x y) -> IO Void
-
data
DnsSubscriptionTarget
=
DnsSubscriptionTarget
{
- dstDomain :: ! Domain
- dstPort :: ! PortNumber
- dstValency :: ! Int
- type DnsSubscriptionParams a = SubscriptionParams a DnsSubscriptionTarget
-
data
NetworkDNSSubscriptionTracers
vNumber addr =
NetworkDNSSubscriptionTracers
{
- ndstMuxTracer :: Tracer IO ( WithMuxBearer ( ConnectionId addr) MuxTrace )
- ndstHandshakeTracer :: Tracer IO ( WithMuxBearer ( ConnectionId addr) ( TraceSendRecv ( Handshake vNumber Term )))
- ndstErrorPolicyTracer :: Tracer IO ( WithAddr addr ErrorPolicyTrace )
- ndstSubscriptionTracer :: Tracer IO ( WithDomainName ( SubscriptionTrace addr))
- ndstDnsTracer :: Tracer IO ( WithDomainName DnsTrace )
- nullNetworkDNSSubscriptionTracers :: NetworkDNSSubscriptionTracers vNumber peerid
- dnsSubscriptionWorker :: forall mode x y. HasInitiator mode ~ True => SocketSnocket -> NetworkDNSSubscriptionTracers NodeToNodeVersion SockAddr -> NetworkMutableState SockAddr -> DnsSubscriptionParams () -> Versions NodeToNodeVersion NodeToNodeVersionData ( OuroborosApplication mode SockAddr ByteString IO x y) -> IO Void
-
newtype
Versions
vNum vData r =
Versions
{
- getVersions :: Map vNum ( Version vData r)
- data DiffusionMode
- simpleSingletonVersions :: vNum -> vData -> r -> Versions vNum vData r
- foldMapVersions :: ( Ord vNum, Foldable f, HasCallStack ) => (x -> Versions vNum extra r) -> f x -> Versions vNum extra r
- combineVersions :: ( Ord vNum, Foldable f, HasCallStack ) => f ( Versions vNum extra r) -> Versions vNum extra r
- nodeToNodeHandshakeCodec :: MonadST m => Codec ( Handshake NodeToNodeVersion Term ) DeserialiseFailure m ByteString
- nodeToNodeVersionCodec :: CodecCBORTerm ( Text , Maybe Int ) NodeToNodeVersion
- nodeToNodeCodecCBORTerm :: NodeToNodeVersion -> CodecCBORTerm Text NodeToNodeVersionData
-
data
ConnectionId
addr =
ConnectionId
{
- localAddress :: !addr
- remoteAddress :: !addr
- type RemoteAddress = SockAddr
- type RemoteConnectionId = ConnectionId RemoteAddress
- data ProtocolLimitFailure
- data Handshake (vNumber :: k) (vParams :: k1)
- data LocalAddresses addr = LocalAddresses { }
- data Socket
- isPipeliningEnabled :: NodeToNodeVersion -> Bool
-
data
ErrorPolicies
=
ErrorPolicies
{
- epAppErrorPolicies :: [ ErrorPolicy ]
- epConErrorPolicies :: [ ErrorPolicy ]
- remoteNetworkErrorPolicy :: ErrorPolicies
- localNetworkErrorPolicy :: ErrorPolicies
- nullErrorPolicies :: ErrorPolicies
-
data
ErrorPolicy
where
- ErrorPolicy :: forall e. Exception e => (e -> Maybe ( SuspendDecision DiffTime )) -> ErrorPolicy
-
data
SuspendDecision
t
- = SuspendPeer !t !t
- | SuspendConsumer !t
- | Throw
- data AcceptConnectionsPolicyTrace
-
data
TraceSendRecv
ps
where
- TraceSendMsg :: forall ps. AnyMessageAndAgency ps -> TraceSendRecv ps
- TraceRecvMsg :: forall ps. AnyMessageAndAgency ps -> TraceSendRecv ps
-
data
SubscriptionTrace
addr
- = SubscriptionTraceConnectStart addr
- | SubscriptionTraceConnectEnd addr ConnectResult
- | Exception e => SubscriptionTraceSocketAllocationException addr e
- | Exception e => SubscriptionTraceConnectException addr e
- | Exception e => SubscriptionTraceApplicationException addr e
- | SubscriptionTraceTryConnectToPeer addr
- | SubscriptionTraceSkippingPeer addr
- | SubscriptionTraceSubscriptionRunning
- | SubscriptionTraceSubscriptionWaiting Int
- | SubscriptionTraceSubscriptionFailed
- | SubscriptionTraceSubscriptionWaitingNewConnection DiffTime
- | SubscriptionTraceStart Int
- | SubscriptionTraceRestart DiffTime Int Int
- | SubscriptionTraceConnectionExist addr
- | SubscriptionTraceUnsupportedRemoteAddr addr
- | SubscriptionTraceMissingLocalAddress
- | SubscriptionTraceAllocateSocket addr
- | SubscriptionTraceCloseSocket addr
- data DnsTrace
-
data
ErrorPolicyTrace
- = ErrorPolicySuspendPeer ( Maybe (ConnectionOrApplicationExceptionTrace SomeException )) DiffTime DiffTime
- | ErrorPolicySuspendConsumer ( Maybe (ConnectionOrApplicationExceptionTrace SomeException )) DiffTime
- | ErrorPolicyLocalNodeError (ConnectionOrApplicationExceptionTrace SomeException )
- | ErrorPolicyResumePeer
- | ErrorPolicyKeepSuspended
- | ErrorPolicyResumeConsumer
- | ErrorPolicyResumeProducer
- | ErrorPolicyUnhandledApplicationException SomeException
- | ErrorPolicyUnhandledConnectionException SomeException
- | ErrorPolicyAcceptException IOException
- data WithIPList a = WithIPList { }
- data WithDomainName a = WithDomainName { }
- data WithAddr addr a = WithAddr { }
- type HandshakeTr ntnAddr ntnVersion = WithMuxBearer ( ConnectionId ntnAddr) ( TraceSendRecv ( Handshake ntnVersion Term ))
- chainSyncMiniProtocolNum :: MiniProtocolNum
- blockFetchMiniProtocolNum :: MiniProtocolNum
- txSubmissionMiniProtocolNum :: MiniProtocolNum
- keepAliveMiniProtocolNum :: MiniProtocolNum
Documentation
nodeToNodeProtocols :: MiniProtocolParameters -> ( ConnectionId addr -> STM m ControlMessage -> NodeToNodeProtocols muxMode bytes m a b) -> NodeToNodeVersion -> OuroborosBundle muxMode addr bytes m a b Source #
Make an
OuroborosApplication
for the bundle of mini-protocols that
make up the overall node-to-node protocol.
This function specifies the wire format protocol numbers.
The application specific protocol numbers start from 2. The
is reserved for the
MiniProtocolNum
0
Handshake
protocol, while
is reserved for DeltaQ messages.
MiniProtocolNum
1
Handshake
protocol is not included in
NodeToNodeProtocols
as it runs
before mux is started but it reusing
MuxBearer
to send and receive
messages. Only when the handshake protocol succeeds, we will know which
protocols to run / multiplex.
These are chosen to not overlap with the node to client protocol numbers (and the handshake protocol number). This is not essential for correctness, but is helpful to allow a single shared implementation of tools that can analyse both protocols, e.g. wireshark plugins.
data NodeToNodeProtocols appType bytes m a b Source #
NodeToNodeProtocols | |
|
data MiniProtocolParameters Source #
MiniProtocolParameters | |
|
data NodeToNodeVersion Source #
Enumeration of node to node protocol versions.
NodeToNodeV_7 |
Changes:
|
NodeToNodeV_8 |
Changes:
|
NodeToNodeV_9 |
Changes:
|
NodeToNodeV_10 |
Changes:
|
Instances
data NodeToNodeVersionData Source #
Version data for NodeToNode protocol
Instances
data NetworkConnectTracers addr vNumber Source #
Tracer used by
connectToNode
(and derivatives, like
connectTo
or
'Ouroboros.Network.NodeToClient.connectTo).
NetworkConnectTracers | |
|
nullNetworkConnectTracers :: NetworkConnectTracers addr vNumber Source #
connectTo :: Snocket IO Socket SockAddr -> NetworkConnectTracers SockAddr NodeToNodeVersion -> Versions NodeToNodeVersion NodeToNodeVersionData ( OuroborosApplication InitiatorMode SockAddr ByteString IO a b) -> Maybe SockAddr -> SockAddr -> IO () Source #
A specialised version of
.
connectToNode
data NetworkServerTracers addr vNumber Source #
Tracers required by a server which handles inbound connections.
NetworkServerTracers | |
|
nullNetworkServerTracers :: NetworkServerTracers addr vNumber Source #
data NetworkMutableState addr Source #
Mutable state maintained by the network component.
NetworkMutableState | |
|
data AcceptedConnectionsLimit Source #
Policy which governs how to limit the number of accepted connections.
AcceptedConnectionsLimit | |
|
Instances
newNetworkMutableState :: IO ( NetworkMutableState addr) Source #
newNetworkMutableStateSTM :: STM ( NetworkMutableState addr) Source #
cleanNetworkMutableState :: NetworkMutableState addr -> IO () Source #
Clean
PeerStates
within
NetworkMutableState
every 200s
withServer :: SocketSnocket -> NetworkServerTracers SockAddr NodeToNodeVersion -> NetworkMutableState SockAddr -> AcceptedConnectionsLimit -> Socket -> Versions NodeToNodeVersion NodeToNodeVersionData ( OuroborosApplication ResponderMode SockAddr ByteString IO a b) -> ErrorPolicies -> IO Void Source #
A specialised version of
.
It forks a thread which runs an accept loop (server thread):
withServerNode
-
when the server thread throws an exception the main thread rethrows
it (by
wait
) -
when an async exception is thrown to kill the main thread the server thread
will be cancelled as well (by
withAsync
)
P2P Governor
data DomainAccessPoint Source #
A product of a
Domain
and
PortNumber
. After resolving the
domain we will use the
PortNumber
to form
SockAddr
.
DomainAccessPoint | |
|
Instances
data PeerAdvertise Source #
Should this peer be advertised to other peers asking for known peers? For certain peers specified by configuration it would be an appropriate policy to keep them private.
Instances
data PeerSelectionTargets Source #
Adjustable targets for the peer selection mechanism.
These are used by the peer selection governor as targets. They are used by the peer churn governor loop as knobs to adjust, to influence the peer selection governor.
The known , established and active peer targets are targets both from below and from above: the governor will attempt to grow or shrink the sets to hit these targets.
Unlike the other targets, the root peer target is "one sided", it is only a target from below. The governor does not try to shrink the root set to hit it, it simply stops looking for more.
There is also an implicit target that enough local root peers are selected as active. This comes from the configuration for local roots, and is not an independently adjustable target.
Instances
Subscription Workers
IP subscription worker
data IPSubscriptionTarget Source #
IPSubscriptionTarget | |
|
Instances
Eq IPSubscriptionTarget | |
Defined in Ouroboros.Network.Subscription.Ip (==) :: IPSubscriptionTarget -> IPSubscriptionTarget -> Bool Source # (/=) :: IPSubscriptionTarget -> IPSubscriptionTarget -> Bool Source # |
|
Show IPSubscriptionTarget | |
Defined in Ouroboros.Network.Subscription.Ip |
type NetworkIPSubscriptionTracers addr vNumber = NetworkSubscriptionTracers WithIPList addr vNumber Source #
data NetworkSubscriptionTracers withIPList addr vNumber Source #
IP subscription tracers.
NetworkSubscriptionTracers | |
|
nullNetworkSubscriptionTracers :: NetworkSubscriptionTracers withIPList addr vNumber Source #
data SubscriptionParams a target Source #
ipSubscriptionWorker
and
dnsSubscriptionWorker
parameters
SubscriptionParams | |
|
ipSubscriptionWorker :: forall mode x y. HasInitiator mode ~ True => SocketSnocket -> NetworkIPSubscriptionTracers SockAddr NodeToNodeVersion -> NetworkMutableState SockAddr -> IPSubscriptionParams () -> Versions NodeToNodeVersion NodeToNodeVersionData ( OuroborosApplication mode SockAddr ByteString IO x y) -> IO Void Source #
ipSubscriptionWorker
which starts given application versions on each
established connection.
DNS subscription worker
data DnsSubscriptionTarget Source #
DnsSubscriptionTarget | |
|
Instances
data NetworkDNSSubscriptionTracers vNumber addr Source #
DNS subscription tracers.
NetworkDNSSubscriptionTracers | |
|
nullNetworkDNSSubscriptionTracers :: NetworkDNSSubscriptionTracers vNumber peerid Source #
dnsSubscriptionWorker :: forall mode x y. HasInitiator mode ~ True => SocketSnocket -> NetworkDNSSubscriptionTracers NodeToNodeVersion SockAddr -> NetworkMutableState SockAddr -> DnsSubscriptionParams () -> Versions NodeToNodeVersion NodeToNodeVersionData ( OuroborosApplication mode SockAddr ByteString IO x y) -> IO Void Source #
dnsSubscriptionWorker
which starts given application versions on each
established connection.
Versions
newtype Versions vNum vData r Source #
The version map supported by the local agent keyed on the version identifier.
Each
Version
contains a function which takes negotiated version data and
returns negotiated application (the
r
type variable).
If one needs to combine multiple versions the simplest way is to use one of
the combinators:
foldMapVersions
,
combineVersions
or the
Semigroup
instance directly:
fold $ (simpleSingletonVersions ...) :| [ (simpleSingletonVersions ...) , (simpleSingletonVersions ...) , ... ]
Versions | |
|
data DiffusionMode Source #
The flag which indicates wheather the node runs only initiator or both
initiator or responder node. It does not however specify weather the node
is using duplex connections, this is implicit see
NodeToNodeV_4
Instances
Eq DiffusionMode Source # | |
Defined in Ouroboros.Network.NodeToNode.Version (==) :: DiffusionMode -> DiffusionMode -> Bool Source # (/=) :: DiffusionMode -> DiffusionMode -> Bool Source # |
|
Show DiffusionMode Source # | |
Defined in Ouroboros.Network.NodeToNode.Version |
simpleSingletonVersions :: vNum -> vData -> r -> Versions vNum vData r Source #
Singleton smart constructor for
Versions
.
foldMapVersions :: ( Ord vNum, Foldable f, HasCallStack ) => (x -> Versions vNum extra r) -> f x -> Versions vNum extra r Source #
combineVersions :: ( Ord vNum, Foldable f, HasCallStack ) => f ( Versions vNum extra r) -> Versions vNum extra r Source #
Codecs
nodeToNodeHandshakeCodec :: MonadST m => Codec ( Handshake NodeToNodeVersion Term ) DeserialiseFailure m ByteString Source #
Handshake
codec for the
node-to-node
protocol suite.
Re-exports
data ConnectionId addr Source #
Connection is identified by local and remote address.
TODO: the type variable which this data type fills in is called
peerid
. We
should renamed to
connectionId
.
ConnectionId | |
|
Instances
type RemoteAddress = SockAddr Source #
data ProtocolLimitFailure Source #
Instances
data Handshake (vNumber :: k) (vParams :: k1) Source #
The handshake mini-protocol is used initially to agree the version and associated parameters of the protocol to use for all subsequent communication.
Instances
ShowProxy ( Handshake vNumber vParams :: Type ) | |
Show ( ClientHasAgency st) | |
Defined in Ouroboros.Network.Protocol.Handshake.Type |
|
Show ( ServerHasAgency st) | |
Defined in Ouroboros.Network.Protocol.Handshake.Type |
|
( Show vNumber, Show vParams) => Show ( Message ( Handshake vNumber vParams) from to) | |
Protocol ( Handshake vNumber vParams) | |
Defined in Ouroboros.Network.Protocol.Handshake.Type data Message ( Handshake vNumber vParams) st st' Source # data ClientHasAgency st Source # data ServerHasAgency st Source # data NobodyHasAgency st Source # exclusionLemma_ClientAndServerHaveAgency :: forall (st :: Handshake vNumber vParams). ClientHasAgency st -> ServerHasAgency st -> Void Source # exclusionLemma_NobodyAndClientHaveAgency :: forall (st :: Handshake vNumber vParams). NobodyHasAgency st -> ClientHasAgency st -> Void Source # exclusionLemma_NobodyAndServerHaveAgency :: forall (st :: Handshake vNumber vParams). NobodyHasAgency st -> ServerHasAgency st -> Void Source # |
|
data Message ( Handshake vNumber vParams) (from :: Handshake vNumber vParams) (to :: Handshake vNumber vParams) | |
Defined in Ouroboros.Network.Protocol.Handshake.Type
data
Message
(
Handshake
vNumber vParams) (from ::
Handshake
vNumber vParams) (to ::
Handshake
vNumber vParams)
where
|
|
data ClientHasAgency (st :: Handshake vNumber vParams) | |
Defined in Ouroboros.Network.Protocol.Handshake.Type
data
ClientHasAgency
(st ::
Handshake
vNumber vParams)
where
|
|
data ServerHasAgency (st :: Handshake vNumber vParams) | |
Defined in Ouroboros.Network.Protocol.Handshake.Type
data
ServerHasAgency
(st ::
Handshake
vNumber vParams)
where
|
|
data NobodyHasAgency (st :: Handshake vNumber vParams) | |
Defined in Ouroboros.Network.Protocol.Handshake.Type
data
NobodyHasAgency
(st ::
Handshake
vNumber vParams)
where
|
data LocalAddresses addr Source #
Instances
Eq addr => Eq ( LocalAddresses addr) | |
Defined in Ouroboros.Network.Subscription.Worker (==) :: LocalAddresses addr -> LocalAddresses addr -> Bool Source # (/=) :: LocalAddresses addr -> LocalAddresses addr -> Bool Source # |
|
Show addr => Show ( LocalAddresses addr) | |
Defined in Ouroboros.Network.Subscription.Worker |
|
Semigroup ( LocalAddresses addr) | |
Defined in Ouroboros.Network.Subscription.Worker (<>) :: LocalAddresses addr -> LocalAddresses addr -> LocalAddresses addr Source # sconcat :: NonEmpty ( LocalAddresses addr) -> LocalAddresses addr Source # stimes :: Integral b => b -> LocalAddresses addr -> LocalAddresses addr Source # |
Basic type for a socket.
isPipeliningEnabled :: NodeToNodeVersion -> Bool Source #
Check whether a version enabling diffusion pipelining has been negotiated.
Error Policies and Peer state
data ErrorPolicies Source #
List of error policies for exception handling and a policy for handing application return values.
ErrorPolicies | |
|
Instances
Semigroup ErrorPolicies | |
Defined in Ouroboros.Network.ErrorPolicy (<>) :: ErrorPolicies -> ErrorPolicies -> ErrorPolicies Source # sconcat :: NonEmpty ErrorPolicies -> ErrorPolicies Source # stimes :: Integral b => b -> ErrorPolicies -> ErrorPolicies Source # |
remoteNetworkErrorPolicy :: ErrorPolicies Source #
A minimal error policy for remote peers, which only handles exceptions raised by `ouroboros-network`.
localNetworkErrorPolicy :: ErrorPolicies Source #
Error policy for local clients. This is equivalent to
nullErrorPolicies
, but explicit in the errors which can be caught.
We are very permissive here, and very strict in the
networkErrorPolicy
. After any failure the client will be
killed and not penalised by this policy. This allows to restart the local
client without a delay.
data ErrorPolicy where Source #
ErrorPolicy | |
|
Instances
Show ErrorPolicy | |
Defined in Ouroboros.Network.ErrorPolicy |
data SuspendDecision t Source #
Semigroup of commands which acts on
PeerState
. The
t
variable might
be initiated to
DiffTime
or
Time m
.
This semigroup allows to either suspend both consumer and producer or just the consumer part.
SuspendPeer !t !t |
peer is suspend; The first
|
SuspendConsumer !t |
suspend local consumer / initiator side until
|
Throw |
throw an error from the main thread. |
Instances
Traces
data AcceptConnectionsPolicyTrace Source #
Trace for the
AcceptConnectionsLimit
policy.
ServerTraceAcceptConnectionRateLimiting DiffTime Int | |
ServerTraceAcceptConnectionHardLimit Word32 | |
ServerTraceAcceptConnectionResume Int |
Instances
data TraceSendRecv ps where Source #
TraceSendMsg :: forall ps. AnyMessageAndAgency ps -> TraceSendRecv ps | |
TraceRecvMsg :: forall ps. AnyMessageAndAgency ps -> TraceSendRecv ps |
Instances
Show ( AnyMessageAndAgency ps) => Show ( TraceSendRecv ps) | |
Defined in Ouroboros.Network.Driver.Simple |
data SubscriptionTrace addr Source #
Instances
Show addr => Show ( SubscriptionTrace addr) | |
Defined in Ouroboros.Network.Subscription.Worker |
data ErrorPolicyTrace Source #
Trace data for error policies
ErrorPolicySuspendPeer ( Maybe (ConnectionOrApplicationExceptionTrace SomeException )) DiffTime DiffTime |
suspending peer with a given exception until |
ErrorPolicySuspendConsumer ( Maybe (ConnectionOrApplicationExceptionTrace SomeException )) DiffTime |
suspending consumer until |
ErrorPolicyLocalNodeError (ConnectionOrApplicationExceptionTrace SomeException ) |
caught a local exception |
ErrorPolicyResumePeer |
resume a peer (both consumer and producer) |
ErrorPolicyKeepSuspended |
consumer was suspended until producer will resume |
ErrorPolicyResumeConsumer |
resume consumer |
ErrorPolicyResumeProducer |
resume producer |
ErrorPolicyUnhandledApplicationException SomeException |
an application throwed an exception, which was not handled by any
|
ErrorPolicyUnhandledConnectionException SomeException |
|
ErrorPolicyAcceptException IOException |
|
Instances
Show ErrorPolicyTrace | |
Defined in Ouroboros.Network.ErrorPolicy |
data WithIPList a Source #
Instances
Show a => Show ( WithIPList a) | |
Defined in Ouroboros.Network.Subscription.Ip |
data WithDomainName a Source #
Instances
Show a => Show ( WithDomainName a) | |
Defined in Ouroboros.Network.Subscription.Dns |
type HandshakeTr ntnAddr ntnVersion = WithMuxBearer ( ConnectionId ntnAddr) ( TraceSendRecv ( Handshake ntnVersion Term )) Source #