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

Ouroboros.Network.Protocol.LocalTxMonitor.Server

Description

A view of the transaction monitor protocol from the point of view of the server.

This provides simple access to the local mempool snapshots, to allow building more monitoring logic from the client side after submitting transactions.

For execution, localTxMonitorServerPeer is provided for conversion into the typed protocol.

Synopsis

Protocol type for the server

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

newtype LocalTxMonitorServer txid tx slot m a Source #

A local tx monitor protocol server, on top of some effect m .

Constructors

LocalTxMonitorServer

Fields

data ServerStIdle txid tx slot m a Source #

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

  • an acquire request,
  • a termination message.

Constructors

ServerStIdle

Fields

data ServerStAcquiring txid tx slot m a where Source #

In the StAcquiring protocol state, the server has agency and must acquire, and hold on to, the current / latest snapshot of its mempool.

Constructors

SendMsgAcquired :: slot -> ServerStAcquired txid tx slot m a -> ServerStAcquiring txid tx slot m a

data ServerStAcquired txid tx slot m a Source #

In the StAcquired protocol state, the server does not have agency and is waiting for a client to either:

  • request the next transaction from the snapshot;
  • check the presence of a given transaction, by its id;
  • await a change in the snapshot and acquire it;
  • release and go back to the StIdle state;

Constructors

ServerStAcquired

Fields

Execution as a typed protocol

localTxMonitorServerPeer :: forall txid tx slot m a. Monad m => LocalTxMonitorServer txid tx slot m a -> Peer ( LocalTxMonitor txid tx slot) AsServer StIdle m a Source #

Interpret a LocalTxMonitorServer action sequence as a Peer on the client-side of the LocalTxMonitor protocol.