Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- subscribe :: LocalSnocket -> NetworkMagic -> Map NodeToClientVersion blockVersion -> SubscriptionTracers a -> SubscriptionParams a -> (NodeToClientVersion -> blockVersion -> NodeToClientProtocols 'InitiatorMode LocalAddress ByteString IO a Void) -> IO ()
- data SubscriptionParams a = SubscriptionParams {
- spAddress :: !LocalAddress
- spReconnectionDelay :: !(Maybe DiffTime)
- spCompleteCb :: Either SomeException a -> Decision
- data SubscriptionTracers a = SubscriptionTracers {}
- data SubscriptionTrace a
- type MuxMode = Mode
- type MuxTrace = Trace
- data WithBearer peerid a
- data ConnectionId addr = ConnectionId {
- localAddress :: !addr
- remoteAddress :: !addr
- newtype LocalAddress = LocalAddress {}
- data NodeToClientProtocols (appType :: Mode) 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
- newtype MiniProtocolCb ctx bytes (m :: Type -> Type) a = MiniProtocolCb {
- runMiniProtocolCb :: ctx -> Channel m bytes -> m (a, Maybe bytes)
- data RunMiniProtocol (mode :: Mode) 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 ControlMessage
Subscription API
:: LocalSnocket | |
-> NetworkMagic | |
-> Map NodeToClientVersion blockVersion | Use |
-> SubscriptionTracers a | |
-> SubscriptionParams a | |
-> (NodeToClientVersion -> blockVersion -> NodeToClientProtocols 'InitiatorMode LocalAddress ByteString IO a Void) | |
-> IO () |
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 SubscriptionParams a Source #
SubscriptionParams | |
|
data SubscriptionTracers a Source #
SubscriptionTracers | |
|
data SubscriptionTrace a Source #
Instances
Show a => Show (SubscriptionTrace a) Source # | |
Defined in Cardano.Client.Subscription showsPrec :: Int -> SubscriptionTrace a -> ShowS # show :: SubscriptionTrace a -> String # showList :: [SubscriptionTrace a] -> ShowS # |
Re-exports
Mux
data WithBearer peerid a #
Type used for tracing mux events.
Instances
Connections
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
.
ConnectionId | |
|
Instances
Functor ConnectionId | |||||
Defined in Ouroboros.Network.ConnectionId fmap :: (a -> b) -> ConnectionId a -> ConnectionId b # (<$) :: a -> ConnectionId b -> ConnectionId a # | |||||
ShowProxy addr => ShowProxy (ConnectionId addr :: Type) | |||||
Defined in Ouroboros.Network.ConnectionId showProxy :: Proxy (ConnectionId addr) -> String # | |||||
Generic (ConnectionId addr) | |||||
Defined in Ouroboros.Network.ConnectionId
from :: ConnectionId addr -> Rep (ConnectionId addr) x # to :: Rep (ConnectionId addr) x -> ConnectionId addr # | |||||
Show addr => Show (ConnectionId addr) | |||||
Defined in Ouroboros.Network.ConnectionId showsPrec :: Int -> ConnectionId addr -> ShowS # show :: ConnectionId addr -> String # showList :: [ConnectionId addr] -> ShowS # | |||||
Eq addr => Eq (ConnectionId addr) | |||||
Defined in Ouroboros.Network.ConnectionId (==) :: ConnectionId addr -> ConnectionId addr -> Bool # (/=) :: ConnectionId addr -> ConnectionId addr -> Bool # | |||||
Ord addr => Ord (ConnectionId addr) | Order first by Note: we relay on the fact that | ||||
Defined in Ouroboros.Network.ConnectionId compare :: ConnectionId addr -> ConnectionId addr -> Ordering # (<) :: ConnectionId addr -> ConnectionId addr -> Bool # (<=) :: ConnectionId addr -> ConnectionId addr -> Bool # (>) :: ConnectionId addr -> ConnectionId addr -> Bool # (>=) :: ConnectionId addr -> ConnectionId addr -> Bool # max :: ConnectionId addr -> ConnectionId addr -> ConnectionId addr # min :: ConnectionId addr -> ConnectionId addr -> ConnectionId addr # | |||||
Hashable a => Hashable (ConnectionId a) | |||||
Defined in Ouroboros.Network.ConnectionId hashWithSalt :: Int -> ConnectionId a -> Int # hash :: ConnectionId a -> Int # | |||||
Typeable addr => NoThunks (ConnectionId addr) | |||||
Defined in Ouroboros.Network.ConnectionId noThunks :: Context -> ConnectionId addr -> IO (Maybe ThunkInfo) # wNoThunks :: Context -> ConnectionId addr -> IO (Maybe ThunkInfo) # showTypeOf :: Proxy (ConnectionId addr) -> String # | |||||
type Rep (ConnectionId addr) | |||||
Defined in Ouroboros.Network.ConnectionId type Rep (ConnectionId addr) = D1 ('MetaData "ConnectionId" "Ouroboros.Network.ConnectionId" "ouroboros-network-framework-0.14.0.0-inplace" 'False) (C1 ('MetaCons "ConnectionId" 'PrefixI 'True) (S1 ('MetaSel ('Just "localAddress") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 addr) :*: S1 ('MetaSel ('Just "remoteAddress") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 addr))) |
newtype 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.14.0.0-inplace" 'True) (C1 ('MetaCons "LocalAddress" 'PrefixI 'True) (S1 ('MetaSel ('Just "getFilePath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath))) |
Protocol API
data NodeToClientProtocols (appType :: Mode) ntcAddr bytes (m :: Type -> Type) a b #
Record of node-to-client mini protocols.
NodeToClientProtocols | |
|
newtype MiniProtocolCb ctx bytes (m :: Type -> Type) a #
A callback executed by each muxed mini-protocol.
MiniProtocolCb | |
|
data RunMiniProtocol (mode :: Mode) 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 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 # |