ouroboros-network-0.1.0.1: A networking layer for the Ouroboros blockchain protocol
Safe Haskell Safe-Inferred
Language Haskell2010

Ouroboros.Network.Protocol.LocalStateQuery.Server

Synopsis

Protocol type for the server

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

newtype LocalStateQueryServer block point (query :: Type -> Type ) m a Source #

Constructors

LocalStateQueryServer

Fields

data ServerStIdle block point query m a Source #

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

  • a request to acquire a state
  • a termination messge

It must be prepared to handle either.

Constructors

ServerStIdle

Fields

data ServerStAcquiring block point query m a where Source #

In the StAcquiring protocol state, the server has agency and must send either:

  • acquired
  • failure to acquire

Constructors

SendMsgAcquired :: ServerStAcquired block point query m a -> ServerStAcquiring block point query m a
SendMsgFailure :: AcquireFailure -> ServerStIdle block point query m a -> ServerStAcquiring block point query m a

data ServerStAcquired block point query m a Source #

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

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

It must be prepared to handle either.

Constructors

ServerStAcquired

Fields

data ServerStQuerying block point query m a result where Source #

In the StQuerying protocol state, the server has agency and must send:

  • a result

Constructors

SendMsgResult :: result -> ServerStAcquired block point query m a -> ServerStQuerying block point query m a result

Execution as a typed protocol

localStateQueryServerPeer :: forall block point (query :: Type -> Type ) m a. Monad m => LocalStateQueryServer block point query m a -> Peer ( LocalStateQuery block point query) AsServer StIdle m a Source #

Interpret a LocalStateQueryServer action sequence as a Peer on the server side of the LocalStateQuery protocol.