ouroboros-network-0.1.0.0: A networking layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.Protocol.LocalStateQuery.Client

Synopsis

Protocol type for the client

The protocol states from the point of view of the client.

newtype LocalStateQueryClient block point (query ∷ TypeType) m a Source #

Constructors

LocalStateQueryClient 

Fields

data ClientStIdle block point query (m ∷ TypeType) a where Source #

In the StIdle protocol state, the client has agency and must send:

  • a request to acquire a state
  • a termination messge

Constructors

SendMsgAcquireMaybe point → ClientStAcquiring block point query m a → ClientStIdle block point query m a 
SendMsgDone ∷ a → ClientStIdle block point query m a 

data ClientStAcquiring block point query m a Source #

In the StAcquiring protocol state, the client does not have agency. Instead it is waiting for:

  • acquired
  • failure to acquire

It must be prepared to handle either.

Constructors

ClientStAcquiring 

Fields

data ClientStAcquired block point query m a where Source #

In the StAcquired protocol state, the client has agency and must send:

  • a query
  • a request to (re)acquire another state
  • a release of the current state

Constructors

SendMsgQuery ∷ query result → ClientStQuerying block point query m a result → ClientStAcquired block point query m a 
SendMsgReAcquireMaybe point → ClientStAcquiring block point query m a → ClientStAcquired block point query m a 
SendMsgRelease ∷ m (ClientStIdle block point query m a) → ClientStAcquired block point query m a 

data ClientStQuerying block point query m a result Source #

In the StQuerying protocol state, the client does not have agency. Instead it is waiting for:

  • a result

Constructors

ClientStQuerying 

Fields

Execution as a typed protocol

localStateQueryClientPeer ∷ ∀ block point (query ∷ TypeType) m a. Monad m ⇒ LocalStateQueryClient block point query m a → Peer (LocalStateQuery block point query) AsClient StIdle m a Source #

Interpret a LocalStateQueryClient action sequence as a Peer on the client side of the LocalStateQuery protocol.

Null local state query client

localStateQueryClientNull ∷ MonadTimer m ⇒ LocalStateQueryClient block point query m a Source #

Deprecated: Use Ouroboros.Network.NodeToClient.localStateQueryPeerNull

Utilities

mapLocalStateQueryClient ∷ ∀ block block' point point' query query' m a. Functor m ⇒ (point → point') → (∀ result. query result → Some query') → (∀ result result'. query result → query' result' → result' → result) → LocalStateQueryClient block point query m a → LocalStateQueryClient block' point' query' m a Source #

Transform a LocalStateQueryClient by mapping over the query and query result values.

Note the direction of the individual mapping functions corresponds to whether the types are used as protocol inputs or outputs.

data Some (f ∷ k → Type) where Source #

Constructors

Some ∷ f a → Some f