cardano-client-0.3.1.2: An API for ouroboros-network
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Client.Subscription

Synopsis

Documentation

subscribe Source #

Arguments

∷ ∀ blockVersion x y. LocalSnocket 
NetworkMagic 
Map NodeToClientVersion blockVersion

Use supportedNodeToClientVersions from `ouroboros-consensus`.

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 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.

Instances

Instances details
Functor ConnectionId 
Instance details

Defined in Ouroboros.Network.ConnectionId

Methods

fmap ∷ (a → b) → ConnectionId a → ConnectionId b #

(<$) ∷ a → ConnectionId b → ConnectionId a #

ShowProxy addr ⇒ ShowProxy (ConnectionId addr ∷ Type) 
Instance details

Defined in Ouroboros.Network.ConnectionId

Methods

showProxyProxy (ConnectionId addr) → String Source #

Generic (ConnectionId addr) 
Instance details

Defined in Ouroboros.Network.ConnectionId

Associated Types

type Rep (ConnectionId addr) ∷ TypeType #

Methods

fromConnectionId addr → Rep (ConnectionId addr) x #

toRep (ConnectionId addr) x → ConnectionId addr #

Show addr ⇒ Show (ConnectionId addr) 
Instance details

Defined in Ouroboros.Network.ConnectionId

Methods

showsPrecIntConnectionId addr → ShowS #

showConnectionId addr → String #

showList ∷ [ConnectionId addr] → ShowS #

Eq addr ⇒ Eq (ConnectionId addr) 
Instance details

Defined in Ouroboros.Network.ConnectionId

Methods

(==)ConnectionId addr → ConnectionId addr → Bool #

(/=)ConnectionId addr → ConnectionId addr → Bool #

Ord addr ⇒ Ord (ConnectionId addr)

Order first by remoteAddress then by localAddress.

Note: we relay on the fact that remoteAddress is an order preserving map (which allows us to use mapKeysMonotonic in some cases).

Instance details

Defined in Ouroboros.Network.ConnectionId

Methods

compareConnectionId addr → ConnectionId addr → Ordering #

(<)ConnectionId addr → ConnectionId addr → Bool #

(<=)ConnectionId addr → ConnectionId addr → Bool #

(>)ConnectionId addr → ConnectionId addr → Bool #

(>=)ConnectionId addr → ConnectionId addr → Bool #

maxConnectionId addr → ConnectionId addr → ConnectionId addr #

minConnectionId addr → ConnectionId addr → ConnectionId addr #

Hashable a ⇒ Hashable (ConnectionId a) 
Instance details

Defined in Ouroboros.Network.ConnectionId

Typeable addr ⇒ NoThunks (ConnectionId addr) 
Instance details

Defined in Ouroboros.Network.ConnectionId

type Rep (ConnectionId addr) 
Instance details

Defined in Ouroboros.Network.ConnectionId

type Rep (ConnectionId addr) = D1 ('MetaData "ConnectionId" "Ouroboros.Network.ConnectionId" "ouroboros-network-framework-0.13.2.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)))

data LocalAddress Source #

Local address, on Unix is associated with AF_UNIX family, on

Windows with `named-pipes`.

Instances

Instances details
Generic LocalAddress 
Instance details

Defined in Ouroboros.Network.Snocket

Associated Types

type Rep LocalAddressTypeType #

Show LocalAddress 
Instance details

Defined in Ouroboros.Network.Snocket

Eq LocalAddress 
Instance details

Defined in Ouroboros.Network.Snocket

Ord LocalAddress 
Instance details

Defined in Ouroboros.Network.Snocket

Hashable LocalAddress 
Instance details

Defined in Ouroboros.Network.Snocket

type Rep LocalAddress 
Instance details

Defined in Ouroboros.Network.Snocket

type Rep LocalAddress = D1 ('MetaData "LocalAddress" "Ouroboros.Network.Snocket" "ouroboros-network-framework-0.13.2.0-inplace" 'True) (C1 ('MetaCons "LocalAddress" 'PrefixI 'True) (S1 ('MetaSel ('Just "getFilePath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)))

data NodeToClientProtocols (appType ∷ MuxMode) ntcAddr bytes (m ∷ TypeType) a b Source #

Record of node-to-client mini protocols.

Constructors

NodeToClientProtocols 

Fields

data MiniProtocolCb ctx bytes (m ∷ TypeType) a where Source #

A callback executed by each muxed mini-protocol.

Constructors

MiniProtocolCb ∷ ∀ ctx (m ∷ TypeType) bytes a. (ctx → Channel m bytes → m (a, Maybe bytes)) → MiniProtocolCb ctx bytes m a 
MuxPeer ∷ ∀ (pr ∷ PeerRole) ps (st ∷ ps) failure ctx bytes (m ∷ TypeType) a. (Show failure, ∀ (st' ∷ ps). Show (ClientHasAgency st'), ∀ (st' ∷ ps). Show (ServerHasAgency st'), ShowProxy ps) ⇒ (ctx → (Tracer m (TraceSendRecv ps), Codec ps failure m bytes, Peer ps pr st m a)) → MiniProtocolCb ctx bytes m a 
MuxPeerPipelined ∷ ∀ (pr ∷ PeerRole) ps (st ∷ ps) failure ctx bytes (m ∷ TypeType) a. (Show failure, ∀ (st' ∷ ps). Show (ClientHasAgency st'), ∀ (st' ∷ ps). Show (ServerHasAgency st'), ShowProxy ps) ⇒ (ctx → (Tracer m (TraceSendRecv ps), Codec ps failure m bytes, PeerPipelined ps pr st m a)) → MiniProtocolCb ctx bytes m a 

Bundled Patterns

pattern MuxPeerRaw ∷ ∀ ctx bytes m a. (ctx → Channel m bytes → m (a, Maybe bytes)) → MiniProtocolCb ctx bytes m a 

data MuxTrace Source #

Enumeration of Mux events that can be traced.

Instances

Instances details
Show MuxTrace 
Instance details

Defined in Network.Mux.Trace

Methods

showsPrecIntMuxTraceShowS #

showMuxTraceString #

showList ∷ [MuxTrace] → ShowS #

data RunMiniProtocol (mode ∷ MuxMode) initiatorCtx responderCtx bytes (m ∷ TypeType) a b where Source #

RunMiniProtocol. It also capture context (the IsBigLedgerPeer) which is passed to the mini-protocol when a mini-protocol is started.

Constructors

InitiatorProtocolOnly ∷ ∀ initiatorCtx bytes (m ∷ TypeType) a responderCtx. MiniProtocolCb initiatorCtx bytes m a → RunMiniProtocol 'InitiatorMode initiatorCtx responderCtx bytes m a Void 
ResponderProtocolOnly ∷ ∀ responderCtx bytes (m ∷ TypeType) b initiatorCtx. MiniProtocolCb responderCtx bytes m b → RunMiniProtocol 'ResponderMode initiatorCtx responderCtx bytes m Void b 
InitiatorAndResponderProtocol ∷ ∀ initiatorCtx bytes (m ∷ TypeType) 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 Source #

Type used for tracing mux events.

Instances

Instances details
Generic (WithMuxBearer peerid a) 
Instance details

Defined in Network.Mux.Trace

Associated Types

type Rep (WithMuxBearer peerid a) ∷ TypeType #

Methods

fromWithMuxBearer peerid a → Rep (WithMuxBearer peerid a) x #

toRep (WithMuxBearer peerid a) x → WithMuxBearer peerid a #

(Show peerid, Show a) ⇒ Show (WithMuxBearer peerid a) 
Instance details

Defined in Network.Mux.Trace

Methods

showsPrecIntWithMuxBearer peerid a → ShowS #

showWithMuxBearer peerid a → String #

showList ∷ [WithMuxBearer peerid a] → ShowS #

type Rep (WithMuxBearer peerid a) 
Instance details

Defined in Network.Mux.Trace

type Rep (WithMuxBearer peerid a) = D1 ('MetaData "WithMuxBearer" "Network.Mux.Trace" "network-mux-0.4.5.2-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 Source #

Control signal sent to a mini-protocol. Expected to exit, on Continue it should continue its operation

Constructors

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

Instances details
Show ControlMessage 
Instance details

Defined in Ouroboros.Network.ControlMessage

Eq ControlMessage 
Instance details

Defined in Ouroboros.Network.ControlMessage