Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- subscribe :: LocalSnocket -> NetworkMagic -> Map NodeToClientVersion blockVersion -> NetworkClientSubcriptionTracers -> ClientSubscriptionParams () -> (NodeToClientVersion -> blockVersion -> NodeToClientProtocols 'InitiatorMode LocalAddress ByteString IO x y) -> IO Void
- data MuxMode where
- data ConnectionId addr
- data LocalAddress
- data NodeToClientProtocols (appType :: MuxMode) ntcAddr bytes (m :: Type -> Type) a b = NodeToClientProtocols {
- localChainSyncProtocol :: RunMiniProtocolWithMinimalCtx appType ntcAddr bytes m a b
- localTxSubmissionProtocol :: RunMiniProtocolWithMinimalCtx appType ntcAddr bytes m a b
- localStateQueryProtocol :: RunMiniProtocolWithMinimalCtx appType ntcAddr bytes m a b
- localTxMonitorProtocol :: RunMiniProtocolWithMinimalCtx appType ntcAddr bytes m a b
- data MiniProtocolCb ctx bytes (m :: Type -> Type) a where
- MiniProtocolCb :: forall ctx (m :: Type -> Type) bytes a. (ctx -> Channel m bytes -> m (a, Maybe bytes)) -> MiniProtocolCb ctx bytes m a
- MuxPeer :: forall (pr :: PeerRole) ps (st :: ps) failure ctx bytes (m :: Type -> Type) a. (ShowProxy ps, forall (st' :: ps) tok. tok ~ StateToken st' => Show tok, Show failure) => (ctx -> (Tracer m (TraceSendRecv ps), Codec ps failure m bytes, Peer ps pr 'NonPipelined st m a)) -> MiniProtocolCb ctx bytes m a
- MuxPeerPipelined :: forall (pr :: PeerRole) ps (st :: ps) failure ctx bytes (m :: Type -> Type) a. (ShowProxy ps, forall (st' :: ps) tok. tok ~ StateToken st' => Show tok, Show failure) => (ctx -> (Tracer m (TraceSendRecv ps), Codec ps failure m bytes, PeerPipelined ps pr st m a)) -> MiniProtocolCb ctx bytes m a
- pattern MuxPeerRaw :: forall ctx bytes m a. (ctx -> Channel m bytes -> m (a, Maybe bytes)) -> MiniProtocolCb ctx bytes m a
- data MuxTrace
- data RunMiniProtocol (mode :: MuxMode) initiatorCtx responderCtx bytes (m :: Type -> Type) a b where
- InitiatorProtocolOnly :: forall initiatorCtx bytes (m :: Type -> Type) a responderCtx. MiniProtocolCb initiatorCtx bytes m a -> RunMiniProtocol 'InitiatorMode initiatorCtx responderCtx bytes m a Void
- ResponderProtocolOnly :: forall responderCtx bytes (m :: Type -> Type) b initiatorCtx. MiniProtocolCb responderCtx bytes m b -> RunMiniProtocol 'ResponderMode initiatorCtx responderCtx bytes m Void b
- InitiatorAndResponderProtocol :: forall initiatorCtx bytes (m :: Type -> Type) a responderCtx b. MiniProtocolCb initiatorCtx bytes m a -> MiniProtocolCb responderCtx bytes m b -> RunMiniProtocol 'InitiatorResponderMode initiatorCtx responderCtx bytes m a b
- data WithMuxBearer peerid a
- data ControlMessage
Documentation
:: LocalSnocket | |
-> NetworkMagic | |
-> Map NodeToClientVersion blockVersion | Use |
-> NetworkClientSubcriptionTracers | |
-> ClientSubscriptionParams () | |
-> (NodeToClientVersion -> blockVersion -> NodeToClientProtocols 'InitiatorMode LocalAddress ByteString IO x y) | |
-> IO Void |
Subscribe using `node-to-client` mini-protocol.
blockVersion
ought to be instantiated with `BlockNodeToClientVersion blk`.
The callback receives blockVersion
associated with each
NodeToClientVersion
and can be used to create codecs with
clientCodecs
.
data ConnectionId addr #
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
.
Instances
data LocalAddress #
Local address, on Unix is associated with AF_UNIX
family, on
Windows with `named-pipes`.
Instances
Generic LocalAddress | |||||
Defined in Ouroboros.Network.Snocket
from :: LocalAddress -> Rep LocalAddress x # to :: Rep LocalAddress x -> LocalAddress # | |||||
Show LocalAddress | |||||
Defined in Ouroboros.Network.Snocket showsPrec :: Int -> LocalAddress -> ShowS # show :: LocalAddress -> String # showList :: [LocalAddress] -> ShowS # | |||||
Eq LocalAddress | |||||
Defined in Ouroboros.Network.Snocket (==) :: LocalAddress -> LocalAddress -> Bool # (/=) :: LocalAddress -> LocalAddress -> Bool # | |||||
Ord LocalAddress | |||||
Defined in Ouroboros.Network.Snocket compare :: LocalAddress -> LocalAddress -> Ordering # (<) :: LocalAddress -> LocalAddress -> Bool # (<=) :: LocalAddress -> LocalAddress -> Bool # (>) :: LocalAddress -> LocalAddress -> Bool # (>=) :: LocalAddress -> LocalAddress -> Bool # max :: LocalAddress -> LocalAddress -> LocalAddress # min :: LocalAddress -> LocalAddress -> LocalAddress # | |||||
Hashable LocalAddress | |||||
Defined in Ouroboros.Network.Snocket hashWithSalt :: Int -> LocalAddress -> Int # hash :: LocalAddress -> Int # | |||||
type Rep LocalAddress | |||||
Defined in Ouroboros.Network.Snocket type Rep LocalAddress = D1 ('MetaData "LocalAddress" "Ouroboros.Network.Snocket" "ouroboros-network-framework-0.13.2.4-inplace" 'True) (C1 ('MetaCons "LocalAddress" 'PrefixI 'True) (S1 ('MetaSel ('Just "getFilePath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath))) |
data NodeToClientProtocols (appType :: MuxMode) ntcAddr bytes (m :: Type -> Type) a b #
Record of node-to-client mini protocols.
NodeToClientProtocols | |
|
data MiniProtocolCb ctx bytes (m :: Type -> Type) a where #
A callback executed by each muxed mini-protocol.
MiniProtocolCb :: forall ctx (m :: Type -> Type) bytes a. (ctx -> Channel m bytes -> m (a, Maybe bytes)) -> MiniProtocolCb ctx bytes m a | |
MuxPeer :: forall (pr :: PeerRole) ps (st :: ps) failure ctx bytes (m :: Type -> Type) a. (ShowProxy ps, forall (st' :: ps) tok. tok ~ StateToken st' => Show tok, Show failure) => (ctx -> (Tracer m (TraceSendRecv ps), Codec ps failure m bytes, Peer ps pr 'NonPipelined st m a)) -> MiniProtocolCb ctx bytes m a | |
MuxPeerPipelined :: forall (pr :: PeerRole) ps (st :: ps) failure ctx bytes (m :: Type -> Type) a. (ShowProxy ps, forall (st' :: ps) tok. tok ~ StateToken st' => Show tok, Show failure) => (ctx -> (Tracer m (TraceSendRecv ps), Codec ps failure m bytes, PeerPipelined ps pr st m a)) -> MiniProtocolCb ctx bytes m a |
pattern MuxPeerRaw :: forall ctx bytes m a. (ctx -> Channel m bytes -> m (a, Maybe bytes)) -> MiniProtocolCb ctx bytes m a |
Enumeration of Mux events that can be traced.
data RunMiniProtocol (mode :: MuxMode) initiatorCtx responderCtx bytes (m :: Type -> Type) a b where #
RunMiniProtocol
. It also capture context (the IsBigLedgerPeer
) which
is passed to the mini-protocol when a mini-protocol is started.
InitiatorProtocolOnly :: forall initiatorCtx bytes (m :: Type -> Type) a responderCtx. MiniProtocolCb initiatorCtx bytes m a -> RunMiniProtocol 'InitiatorMode initiatorCtx responderCtx bytes m a Void | |
ResponderProtocolOnly :: forall responderCtx bytes (m :: Type -> Type) b initiatorCtx. MiniProtocolCb responderCtx bytes m b -> RunMiniProtocol 'ResponderMode initiatorCtx responderCtx bytes m Void b | |
InitiatorAndResponderProtocol :: forall initiatorCtx bytes (m :: Type -> Type) a responderCtx b. MiniProtocolCb initiatorCtx bytes m a -> MiniProtocolCb responderCtx bytes m b -> RunMiniProtocol 'InitiatorResponderMode initiatorCtx responderCtx bytes m a b |
data WithMuxBearer peerid a #
Type used for tracing mux events.
Instances
Generic (WithMuxBearer peerid a) | |||||
Defined in Network.Mux.Trace
from :: WithMuxBearer peerid a -> Rep (WithMuxBearer peerid a) x # to :: Rep (WithMuxBearer peerid a) x -> WithMuxBearer peerid a # | |||||
(Show peerid, Show a) => Show (WithMuxBearer peerid a) | |||||
Defined in Network.Mux.Trace showsPrec :: Int -> WithMuxBearer peerid a -> ShowS # show :: WithMuxBearer peerid a -> String # showList :: [WithMuxBearer peerid a] -> ShowS # | |||||
type Rep (WithMuxBearer peerid a) | |||||
Defined in Network.Mux.Trace type Rep (WithMuxBearer peerid a) = D1 ('MetaData "WithMuxBearer" "Network.Mux.Trace" "network-mux-0.4.5.3-inplace" 'False) (C1 ('MetaCons "WithMuxBearer" 'PrefixI 'True) (S1 ('MetaSel ('Just "wmbPeerId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 peerid) :*: S1 ('MetaSel ('Just "wmbEvent") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a))) |
data ControlMessage #
Control signal sent to a mini-protocol. Expected to exit, on Continue
it
should continue its operation
Continue | Continue operation. |
Quiesce | Hold on, e.g. do not sent messages until resumed. This is not used for any hot protocol. |
Terminate | The client is expected to terminate as soon as possible. |
Instances
Show ControlMessage | |
Defined in Ouroboros.Network.ControlMessage showsPrec :: Int -> ControlMessage -> ShowS # show :: ControlMessage -> String # showList :: [ControlMessage] -> ShowS # | |
Eq ControlMessage | |
Defined in Ouroboros.Network.ControlMessage (==) :: ControlMessage -> ControlMessage -> Bool # (/=) :: ControlMessage -> ControlMessage -> Bool # |