ouroboros-network-protocols-0.8.1.0: Ouroboros Network Protocols
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Network.Protocol.LocalTxMonitor.Type

Description

The type of the local transaction monitoring protocol.

This is used by local clients (like wallets, explorers and CLI tools) to monitor the transactions passing through the mempool of a local node.

The protocol is stateful such that the server keeps track of the transactions already sent to the client.

                   START
                     ⇓
                   ┌───────────────┐
           ┌──────▶│     Idle      │⇒ DONE
           │       └───┬───────────┘
           │           │
           │   Acquire │
           │           ▼
           │       ┌───────────────┐
   Release │       │   Acquiring   │
           │       └───┬───────────┘
           │           │       ▲
           │  Acquired │       │ AwaitAcquire
           │           ▼       │
           │       ┌───────────┴───┐
           └───────┤   Acquired    │
                   └───┬───────────┘
                       │       ▲
 HasTx|NextTx|GetSizes │       │ Reply (HasTx|NextTx|GetSizes)
                       ▼       │
                   ┌───────────┴───┐
                   │      Busy     │
                   └───────────────┘
Synopsis

Documentation

data LocalTxMonitor txid tx slot where Source #

The kind of the local transaction monitoring protocol, and the types of the states in the protocol state machine.

It is parametrised over the type of transactions.

Constructors

StIdleLocalTxMonitor txid tx slot

The client has agency; it can request a transaction or terminate.

There is no timeout in this state.

StAcquiringLocalTxMonitor txid tx slot

The server has agency; it is capturing the latest mempool snapshot.

StAcquiredLocalTxMonitor txid tx slot

The client has agency; The server is locked on a particular mempool snapshot. The client can now perform various requests on that snapshot, or acquire a new one, more recent.

StBusyStBusyKindLocalTxMonitor txid tx slot

The server has agency; It must respond, there's no timeout.

StDoneLocalTxMonitor txid tx slot

Nobody has agency. The terminal state.

Instances

Instances details
(ShowProxy txid, ShowProxy tx, ShowProxy slot) ⇒ ShowProxy (LocalTxMonitor txid tx slot ∷ Type) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

showProxyProxy (LocalTxMonitor txid tx slot) → String Source #

Show (ClientHasAgency st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Show (ServerHasAgency st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

NFData (ClientHasAgency st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

rnfClientHasAgency st → () #

NFData (NobodyHasAgency st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

rnfNobodyHasAgency st → () #

NFData (ServerHasAgency st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

rnfServerHasAgency st → () #

(Show txid, Show tx, Show slot) ⇒ Show (Message (LocalTxMonitor txid tx slot) from to) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

showsPrecIntMessage (LocalTxMonitor txid tx slot) from to → ShowS #

showMessage (LocalTxMonitor txid tx slot) from to → String #

showList ∷ [Message (LocalTxMonitor txid tx slot) from to] → ShowS #

(NFData txid, NFData tx, NFData slot) ⇒ NFData (Message (LocalTxMonitor txid tx slot) from to) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

rnfMessage (LocalTxMonitor txid tx slot) from to → () #

NFData (PeerHasAgency pr st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

rnfPeerHasAgency pr st → () #

Protocol (LocalTxMonitor txid tx slot) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Associated Types

data Message (LocalTxMonitor txid tx slot) st st' Source #

data ClientHasAgency st Source #

data ServerHasAgency st Source #

data NobodyHasAgency st Source #

data ClientHasAgency (st ∷ LocalTxMonitor txid tx slot) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

data ClientHasAgency (st ∷ LocalTxMonitor txid tx slot) where
data Message (LocalTxMonitor txid tx slot) (from ∷ LocalTxMonitor txid tx slot) (to ∷ LocalTxMonitor txid tx slot) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

data Message (LocalTxMonitor txid tx slot) (from ∷ LocalTxMonitor txid tx slot) (to ∷ LocalTxMonitor txid tx slot) where
data NobodyHasAgency (st ∷ LocalTxMonitor txid tx slot) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

data NobodyHasAgency (st ∷ LocalTxMonitor txid tx slot) where
data ServerHasAgency (st ∷ LocalTxMonitor txid tx slot) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

data ServerHasAgency (st ∷ LocalTxMonitor txid tx slot) where

data StBusyKind where Source #

Constructors

NextTxStBusyKind

The server is busy fetching the next transaction from the mempool

HasTxStBusyKind

The server is busy looking for the presence of a specific transaction in the mempool

GetSizesStBusyKind

The server is busy looking for the current size and max capacity of the mempool

data MempoolSizeAndCapacity Source #

Describes the MemPool sizes and capacity for a given snapshot.

Constructors

MempoolSizeAndCapacity 

Fields

  • capacityInBytes ∷ !Word32

    The maximum capacity of the mempool. Note that this may dynamically change when the ledger state is updated.

  • sizeInBytes ∷ !Word32

    The summed byte size of all the transactions in the mempool.

  • numberOfTxs ∷ !Word32

    The number of transactions in the mempool

Instances

Instances details
Generic MempoolSizeAndCapacity Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Associated Types

type Rep MempoolSizeAndCapacityTypeType #

Show MempoolSizeAndCapacity Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

NFData MempoolSizeAndCapacity Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

rnfMempoolSizeAndCapacity → () #

Eq MempoolSizeAndCapacity Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

type Rep MempoolSizeAndCapacity Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

type Rep MempoolSizeAndCapacity = D1 ('MetaData "MempoolSizeAndCapacity" "Ouroboros.Network.Protocol.LocalTxMonitor.Type" "ouroboros-network-protocols-0.8.1.0-inplace" 'False) (C1 ('MetaCons "MempoolSizeAndCapacity" 'PrefixI 'True) (S1 ('MetaSel ('Just "capacityInBytes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: (S1 ('MetaSel ('Just "sizeInBytes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "numberOfTxs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32))))

data TokBusyKind (k ∷ StBusyKind) where Source #

Instances

Instances details
NFData (TokBusyKind k) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

rnfTokBusyKind k → () #