Safe Haskell | Safe-Inferred |
---|---|
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 tx slot
where
- StIdle :: LocalTxMonitor txid tx slot
- StAcquiring :: LocalTxMonitor txid tx slot
- StAcquired :: LocalTxMonitor txid tx slot
- StBusy :: StBusyKind -> LocalTxMonitor txid tx slot
- StDone :: LocalTxMonitor txid tx slot
-
data
StBusyKind
where
- NextTx :: StBusyKind
- HasTx :: StBusyKind
- GetSizes :: StBusyKind
-
data
MempoolSizeAndCapacity
=
MempoolSizeAndCapacity
{
- capacityInBytes :: ! Word32
- sizeInBytes :: ! Word32
- numberOfTxs :: ! Word32
- data TokBusyKind (k :: StBusyKind ) where
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.
StIdle :: LocalTxMonitor txid tx slot |
The client has agency; it can request a transaction or terminate. There is no timeout in this state. |
StAcquiring :: LocalTxMonitor txid tx slot |
The server has agency; it is capturing the latest mempool snapshot. |
StAcquired :: 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 :: StBusyKind -> LocalTxMonitor txid tx slot |
The server has agency; It must respond, there's no timeout. |
StDone :: LocalTxMonitor txid tx slot |
Nobody has agency. The terminal state. |
Instances
( ShowProxy txid, ShowProxy tx, ShowProxy slot) => ShowProxy ( LocalTxMonitor txid tx slot :: Type ) Source # | |
|
|
Show ( ClientHasAgency st) Source # | |
|
|
Show ( ServerHasAgency st) Source # | |
|
|
( Show txid, Show tx, Show slot) => Show ( Message ( LocalTxMonitor txid tx slot) from to) Source # | |
|
|
Protocol ( LocalTxMonitor txid tx slot) Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type data Message ( LocalTxMonitor txid tx slot) st st' Source # data ClientHasAgency st Source # data ServerHasAgency st Source # data NobodyHasAgency st Source # exclusionLemma_ClientAndServerHaveAgency :: forall (st :: LocalTxMonitor txid tx slot). ClientHasAgency st -> ServerHasAgency st -> Void Source # exclusionLemma_NobodyAndClientHaveAgency :: forall (st :: LocalTxMonitor txid tx slot). NobodyHasAgency st -> ClientHasAgency st -> Void Source # exclusionLemma_NobodyAndServerHaveAgency :: forall (st :: LocalTxMonitor txid tx slot). NobodyHasAgency st -> ServerHasAgency st -> Void Source # |
|
data Message ( LocalTxMonitor txid tx slot) (from :: LocalTxMonitor txid tx slot) (to :: LocalTxMonitor txid tx slot) Source # | |
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 ClientHasAgency (st :: LocalTxMonitor txid tx slot) Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type
data
ClientHasAgency
(st ::
LocalTxMonitor
txid tx slot)
where
|
|
data ServerHasAgency (st :: LocalTxMonitor txid tx slot) Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type
data
ServerHasAgency
(st ::
LocalTxMonitor
txid tx slot)
where
|
|
data NobodyHasAgency (st :: LocalTxMonitor txid tx slot) Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type
data
NobodyHasAgency
(st ::
LocalTxMonitor
txid tx slot)
where
|
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 MempoolSizeAndCapacity Source #
Describes the MemPool sizes and capacity for a given snapshot.
MempoolSizeAndCapacity | |
|
Instances
Eq MempoolSizeAndCapacity Source # | |
|
|
Show MempoolSizeAndCapacity Source # | |
|
|
Generic 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-0.1.0.1-2UgqzRSdBh49QYumtriFSI" '
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 #