ouroboros-network-protocols
Safe HaskellNone
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 :: k) (tx :: k1) (slot :: k2) 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

StIdle :: forall {k} {k1} {k2} (txid :: k) (tx :: k1) (slot :: k2). LocalTxMonitor txid tx slot

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

There is no timeout in this state.

StAcquiring :: forall {k} {k1} {k2} (txid :: k) (tx :: k1) (slot :: k2). LocalTxMonitor txid tx slot

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

StAcquired :: forall {k} {k1} {k2} (txid :: k) (tx :: k1) (slot :: k2). LocalTxMonitor 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.

StBusy :: forall {k} {k1} {k2} (txid :: k) (tx :: k1) (slot :: k2). StBusyKind -> LocalTxMonitor txid tx slot

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

StDone :: forall {k} {k1} {k2} (txid :: k) (tx :: k1) (slot :: k2). LocalTxMonitor 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

showProxy :: Proxy (LocalTxMonitor txid tx slot) -> String #

(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

rnf :: Message (LocalTxMonitor txid tx slot) from to -> () #

(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

showsPrec :: Int -> Message (LocalTxMonitor txid tx slot) from to -> ShowS #

show :: Message (LocalTxMonitor txid tx slot) from to -> String #

showList :: [Message (LocalTxMonitor txid tx slot) from to] -> ShowS #

Protocol (LocalTxMonitor txid tx slot) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Associated Types

type StateToken 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

StateTokenI ('StAcquired :: LocalTxMonitor txid tx slot) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

stateToken :: StateToken ('StAcquired :: LocalTxMonitor txid tx slot) #

StateTokenI ('StAcquiring :: LocalTxMonitor txid tx slot) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

stateToken :: StateToken ('StAcquiring :: LocalTxMonitor txid tx slot) #

StateTokenI ('StDone :: LocalTxMonitor txid tx slot) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

stateToken :: StateToken ('StDone :: LocalTxMonitor txid tx slot) #

StateTokenI ('StIdle :: LocalTxMonitor txid tx slot) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

stateToken :: StateToken ('StIdle :: LocalTxMonitor txid tx slot) #

SingI k4 => StateTokenI ('StBusy k4 :: LocalTxMonitor txid tx slot) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

stateToken :: StateToken ('StBusy k4 :: LocalTxMonitor txid tx slot) #

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
type StateToken Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

type StateAgency ('StAcquired :: LocalTxMonitor txid tx slot) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

type StateAgency ('StAcquiring :: LocalTxMonitor txid tx slot) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

type StateAgency ('StDone :: LocalTxMonitor txid tx slot) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

type StateAgency ('StDone :: LocalTxMonitor txid tx slot) = 'NobodyAgency
type StateAgency ('StIdle :: LocalTxMonitor txid tx slot) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

type StateAgency ('StIdle :: LocalTxMonitor txid tx slot) = 'ClientAgency
type StateAgency ('StBusy _1 :: LocalTxMonitor txid tx slot) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

type StateAgency ('StBusy _1 :: LocalTxMonitor txid tx slot) = 'ServerAgency

data SingLocalTxMonitor (st :: LocalTxMonitor txid tx slot) where Source #

Constructors

SingIdle :: forall {k} {k1} {k2} {txid :: k} {tx :: k1} {slot :: k2}. SingLocalTxMonitor ('StIdle :: LocalTxMonitor txid tx slot) 
SingAcquiring :: forall {k} {k1} {k2} {txid :: k} {tx :: k1} {slot :: k2}. SingLocalTxMonitor ('StAcquiring :: LocalTxMonitor txid tx slot) 
SingAcquired :: forall {k} {k1} {k2} {txid :: k} {tx :: k1} {slot :: k2}. SingLocalTxMonitor ('StAcquired :: LocalTxMonitor txid tx slot) 
SingBusy :: forall {k} {k1} {k2} {txid :: k} {tx :: k1} {slot :: k2} (k3 :: StBusyKind). SingBusyKind k3 -> SingLocalTxMonitor ('StBusy k3 :: LocalTxMonitor txid tx slot) 
SingDone :: forall {k} {k1} {k2} {txid :: k} {tx :: k1} {slot :: k2}. SingLocalTxMonitor ('StDone :: LocalTxMonitor txid tx slot) 

data StBusyKind where Source #

Constructors

NextTx :: StBusyKind

The server is busy fetching the next transaction from the mempool

HasTx :: StBusyKind

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

GetSizes :: StBusyKind

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

Instances

Instances details
SingI 'GetSizes Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

sing :: Sing 'GetSizes #

SingI 'HasTx Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

sing :: Sing 'HasTx #

SingI 'NextTx Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

sing :: Sing 'NextTx #

type Sing Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

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
NFData MempoolSizeAndCapacity Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Methods

rnf :: MempoolSizeAndCapacity -> () #

Generic MempoolSizeAndCapacity Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

Associated Types

type Rep MempoolSizeAndCapacity 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

type Rep MempoolSizeAndCapacity = D1 ('MetaData "MempoolSizeAndCapacity" "Ouroboros.Network.Protocol.LocalTxMonitor.Type" "ouroboros-network-protocols-0.12.0.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))))
Show MempoolSizeAndCapacity Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type

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

rnf :: TokBusyKind k -> () #