Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- data LocalTxMonitor (txid :: k) (tx :: k1) (slot :: k2) where
- StIdle :: forall {k} {k1} {k2} (txid :: k) (tx :: k1) (slot :: k2). LocalTxMonitor txid tx slot
- StAcquiring :: forall {k} {k1} {k2} (txid :: k) (tx :: k1) (slot :: k2). LocalTxMonitor txid tx slot
- StAcquired :: forall {k} {k1} {k2} (txid :: k) (tx :: k1) (slot :: k2). LocalTxMonitor txid tx slot
- StBusy :: forall {k} {k1} {k2} (txid :: k) (tx :: k1) (slot :: k2). StBusyKind -> LocalTxMonitor txid tx slot
- StDone :: forall {k} {k1} {k2} (txid :: k) (tx :: k1) (slot :: k2). LocalTxMonitor txid tx slot
- data SingLocalTxMonitor (st :: LocalTxMonitor txid tx slot) where
- 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
- data SingBusyKind (st :: StBusyKind) where
- data MempoolSizeAndCapacity = MempoolSizeAndCapacity {
- capacityInBytes :: !Word32
- sizeInBytes :: !Word32
- numberOfTxs :: !Word32
- data TokBusyKind (k :: StBusyKind) where
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.
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
data SingLocalTxMonitor (st :: LocalTxMonitor txid tx slot) where Source #
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) |
Instances
Show (SingLocalTxMonitor st) Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type showsPrec :: Int -> SingLocalTxMonitor st -> ShowS # show :: SingLocalTxMonitor st -> String # showList :: [SingLocalTxMonitor st] -> ShowS # |
data StBusyKind where Source #
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 |
data SingBusyKind (st :: StBusyKind) where Source #
SingNextTx :: SingBusyKind 'NextTx | |
SingHasTx :: SingBusyKind 'HasTx | |
SingGetSizes :: SingBusyKind 'GetSizes |
Instances
Show (SingBusyKind st) Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type showsPrec :: Int -> SingBusyKind st -> ShowS # show :: SingBusyKind st -> String # showList :: [SingBusyKind st] -> ShowS # |
data MempoolSizeAndCapacity Source #
Describes the MemPool sizes and capacity for a given snapshot.
MempoolSizeAndCapacity | |
|
Instances
NFData MempoolSizeAndCapacity Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type rnf :: MempoolSizeAndCapacity -> () # | |||||
Generic MempoolSizeAndCapacity Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type
| |||||
Show MempoolSizeAndCapacity Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type showsPrec :: Int -> MempoolSizeAndCapacity -> ShowS # show :: MempoolSizeAndCapacity -> String # showList :: [MempoolSizeAndCapacity] -> ShowS # | |||||
Eq MempoolSizeAndCapacity Source # | |||||
type Rep MempoolSizeAndCapacity Source # | |||||
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 #
TokNextTx :: TokBusyKind 'NextTx | |
TokHasTx :: TokBusyKind 'HasTx | |
TokGetSizes :: TokBusyKind 'GetSizes |
Instances
NFData (TokBusyKind k) Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type rnf :: TokBusyKind k -> () # |