| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
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| │ │ Reply (HasTx|NextTx
GetSizes|GetMeasures │ │ |GetSizes|GetMeasures)
│ │
▼ │
┌───────────┴───┐
│ Busy │
└───────────────┘
Synopsis
- data LocalTxMonitor txid tx slot where
- StIdle :: forall txid tx slot. LocalTxMonitor txid tx slot
- StAcquiring :: forall txid tx slot. LocalTxMonitor txid tx slot
- StAcquired :: forall txid tx slot. LocalTxMonitor txid tx slot
- StBusy :: forall txid tx slot. StBusyKind -> LocalTxMonitor txid tx slot
- StDone :: forall txid tx slot. LocalTxMonitor txid tx slot
- data SingLocalTxMonitor (st :: LocalTxMonitor txid tx slot) where
- SingIdle :: forall {txid} {tx} {slot}. SingLocalTxMonitor ('StIdle :: LocalTxMonitor txid tx slot)
- SingAcquiring :: forall {txid} {tx} {slot}. SingLocalTxMonitor ('StAcquiring :: LocalTxMonitor txid tx slot)
- SingAcquired :: forall {txid} {tx} {slot}. SingLocalTxMonitor ('StAcquired :: LocalTxMonitor txid tx slot)
- SingBusy :: forall {txid} {tx} {slot} (k :: StBusyKind). SingBusyKind k -> SingLocalTxMonitor ('StBusy k :: LocalTxMonitor txid tx slot)
- SingDone :: forall {txid} {tx} {slot}. SingLocalTxMonitor ('StDone :: LocalTxMonitor txid tx slot)
- data StBusyKind where
- data SingBusyKind (st :: StBusyKind) where
- data MempoolSizeAndCapacity = MempoolSizeAndCapacity {
- capacityInBytes :: !Word32
- sizeInBytes :: !Word32
- numberOfTxs :: !Word32
- data SizeAndCapacity a = SizeAndCapacity {}
- newtype MeasureName = MeasureName Text
- data MempoolMeasures = MempoolMeasures {
- txCount :: !Word32
- measuresMap :: !(Map MeasureName (SizeAndCapacity Integer))
- data LocalTxMonitorVersion
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 parameterised over the type of transactions.
Constructors
| StIdle :: forall txid tx slot. LocalTxMonitor txid tx slot | The client has agency; it can request a transaction or terminate. There is no timeout in this state. |
| StAcquiring :: forall txid tx slot. LocalTxMonitor txid tx slot | The server has agency; it is capturing the latest mempool snapshot. |
| StAcquired :: forall txid tx slot. 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 txid tx slot. StBusyKind -> LocalTxMonitor txid tx slot | The server has agency; It must respond, there's no timeout. |
| StDone :: forall txid tx slot. LocalTxMonitor txid tx slot | Nobody has agency. The terminal state. |
Instances
data SingLocalTxMonitor (st :: LocalTxMonitor txid tx slot) where Source #
Constructors
| SingIdle :: forall {txid} {tx} {slot}. SingLocalTxMonitor ('StIdle :: LocalTxMonitor txid tx slot) | |
| SingAcquiring :: forall {txid} {tx} {slot}. SingLocalTxMonitor ('StAcquiring :: LocalTxMonitor txid tx slot) | |
| SingAcquired :: forall {txid} {tx} {slot}. SingLocalTxMonitor ('StAcquired :: LocalTxMonitor txid tx slot) | |
| SingBusy :: forall {txid} {tx} {slot} (k :: StBusyKind). SingBusyKind k -> SingLocalTxMonitor ('StBusy k :: LocalTxMonitor txid tx slot) | |
| SingDone :: forall {txid} {tx} {slot}. SingLocalTxMonitor ('StDone :: LocalTxMonitor txid tx slot) |
Instances
| Show (SingLocalTxMonitor st) Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods showsPrec :: Int -> SingLocalTxMonitor st -> ShowS # show :: SingLocalTxMonitor st -> String # showList :: [SingLocalTxMonitor st] -> ShowS # | |
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 |
| GetMeasures :: StBusyKind | The server is busy looking for the current size and max capacity of the mempool |
data SingBusyKind (st :: StBusyKind) where Source #
Constructors
| SingNextTx :: SingBusyKind 'NextTx | |
| SingHasTx :: SingBusyKind 'HasTx | |
| SingGetSizes :: SingBusyKind 'GetSizes | |
| SingGetMeasures :: SingBusyKind 'GetMeasures |
Instances
| Show (SingBusyKind st) Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods 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.
Constructors
| MempoolSizeAndCapacity | |
Fields
| |
Instances
| NFData MempoolSizeAndCapacity Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods rnf :: MempoolSizeAndCapacity -> () # | |||||
| Generic MempoolSizeAndCapacity Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Associated Types
Methods from :: MempoolSizeAndCapacity -> Rep MempoolSizeAndCapacity x # to :: Rep MempoolSizeAndCapacity x -> MempoolSizeAndCapacity # | |||||
| Show MempoolSizeAndCapacity Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods showsPrec :: Int -> MempoolSizeAndCapacity -> ShowS # show :: MempoolSizeAndCapacity -> String # showList :: [MempoolSizeAndCapacity] -> ShowS # | |||||
| Eq MempoolSizeAndCapacity Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods (==) :: MempoolSizeAndCapacity -> MempoolSizeAndCapacity -> Bool # (/=) :: MempoolSizeAndCapacity -> MempoolSizeAndCapacity -> Bool # | |||||
| 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.23.0.0-inplace-protocols" '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 SizeAndCapacity a Source #
Constructors
| SizeAndCapacity | |
Instances
| Functor SizeAndCapacity Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods fmap :: (a -> b) -> SizeAndCapacity a -> SizeAndCapacity b # (<$) :: a -> SizeAndCapacity b -> SizeAndCapacity a # | |||||
| NFData a => NFData (SizeAndCapacity a) Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods rnf :: SizeAndCapacity a -> () # | |||||
| Generic (SizeAndCapacity a) Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Associated Types
Methods from :: SizeAndCapacity a -> Rep (SizeAndCapacity a) x # to :: Rep (SizeAndCapacity a) x -> SizeAndCapacity a # | |||||
| Show a => Show (SizeAndCapacity a) Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods showsPrec :: Int -> SizeAndCapacity a -> ShowS # show :: SizeAndCapacity a -> String # showList :: [SizeAndCapacity a] -> ShowS # | |||||
| Eq a => Eq (SizeAndCapacity a) Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods (==) :: SizeAndCapacity a -> SizeAndCapacity a -> Bool # (/=) :: SizeAndCapacity a -> SizeAndCapacity a -> Bool # | |||||
| type Rep (SizeAndCapacity a) Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type type Rep (SizeAndCapacity a) = D1 ('MetaData "SizeAndCapacity" "Ouroboros.Network.Protocol.LocalTxMonitor.Type" "ouroboros-network-0.23.0.0-inplace-protocols" 'False) (C1 ('MetaCons "SizeAndCapacity" 'PrefixI 'True) (S1 ('MetaSel ('Just "size") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "capacity") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a))) | |||||
newtype MeasureName Source #
Constructors
| MeasureName Text |
Instances
| NFData MeasureName Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods rnf :: MeasureName -> () # | |||||
| Generic MeasureName Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Associated Types
| |||||
| Show MeasureName Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods showsPrec :: Int -> MeasureName -> ShowS # show :: MeasureName -> String # showList :: [MeasureName] -> ShowS # | |||||
| Eq MeasureName Source # | |||||
| Ord MeasureName Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods compare :: MeasureName -> MeasureName -> Ordering # (<) :: MeasureName -> MeasureName -> Bool # (<=) :: MeasureName -> MeasureName -> Bool # (>) :: MeasureName -> MeasureName -> Bool # (>=) :: MeasureName -> MeasureName -> Bool # max :: MeasureName -> MeasureName -> MeasureName # min :: MeasureName -> MeasureName -> MeasureName # | |||||
| type Rep MeasureName Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type type Rep MeasureName = D1 ('MetaData "MeasureName" "Ouroboros.Network.Protocol.LocalTxMonitor.Type" "ouroboros-network-0.23.0.0-inplace-protocols" 'True) (C1 ('MetaCons "MeasureName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) | |||||
data MempoolMeasures Source #
Constructors
| MempoolMeasures | |
Fields
| |
Instances
| NFData MempoolMeasures Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods rnf :: MempoolMeasures -> () # | |||||
| Generic MempoolMeasures Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Associated Types
Methods from :: MempoolMeasures -> Rep MempoolMeasures x # to :: Rep MempoolMeasures x -> MempoolMeasures # | |||||
| Show MempoolMeasures Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods showsPrec :: Int -> MempoolMeasures -> ShowS # show :: MempoolMeasures -> String # showList :: [MempoolMeasures] -> ShowS # | |||||
| Eq MempoolMeasures Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods (==) :: MempoolMeasures -> MempoolMeasures -> Bool # (/=) :: MempoolMeasures -> MempoolMeasures -> Bool # | |||||
| type Rep MempoolMeasures Source # | |||||
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type type Rep MempoolMeasures = D1 ('MetaData "MempoolMeasures" "Ouroboros.Network.Protocol.LocalTxMonitor.Type" "ouroboros-network-0.23.0.0-inplace-protocols" 'False) (C1 ('MetaCons "MempoolMeasures" 'PrefixI 'True) (S1 ('MetaSel ('Just "txCount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "measuresMap") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map MeasureName (SizeAndCapacity Integer))))) | |||||
data LocalTxMonitorVersion Source #
Constructors
| LocalTxMonitor_V1 | |
| LocalTxMonitor_V2 |
Instances
| Bounded LocalTxMonitorVersion Source # | |
| Enum LocalTxMonitorVersion Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods succ :: LocalTxMonitorVersion -> LocalTxMonitorVersion # pred :: LocalTxMonitorVersion -> LocalTxMonitorVersion # toEnum :: Int -> LocalTxMonitorVersion # fromEnum :: LocalTxMonitorVersion -> Int # enumFrom :: LocalTxMonitorVersion -> [LocalTxMonitorVersion] # enumFromThen :: LocalTxMonitorVersion -> LocalTxMonitorVersion -> [LocalTxMonitorVersion] # enumFromTo :: LocalTxMonitorVersion -> LocalTxMonitorVersion -> [LocalTxMonitorVersion] # enumFromThenTo :: LocalTxMonitorVersion -> LocalTxMonitorVersion -> LocalTxMonitorVersion -> [LocalTxMonitorVersion] # | |
| Show LocalTxMonitorVersion Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods showsPrec :: Int -> LocalTxMonitorVersion -> ShowS # show :: LocalTxMonitorVersion -> String # showList :: [LocalTxMonitorVersion] -> ShowS # | |
| Eq LocalTxMonitorVersion Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods (==) :: LocalTxMonitorVersion -> LocalTxMonitorVersion -> Bool # (/=) :: LocalTxMonitorVersion -> LocalTxMonitorVersion -> Bool # | |
| Ord LocalTxMonitorVersion Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods compare :: LocalTxMonitorVersion -> LocalTxMonitorVersion -> Ordering # (<) :: LocalTxMonitorVersion -> LocalTxMonitorVersion -> Bool # (<=) :: LocalTxMonitorVersion -> LocalTxMonitorVersion -> Bool # (>) :: LocalTxMonitorVersion -> LocalTxMonitorVersion -> Bool # (>=) :: LocalTxMonitorVersion -> LocalTxMonitorVersion -> Bool # max :: LocalTxMonitorVersion -> LocalTxMonitorVersion -> LocalTxMonitorVersion # min :: LocalTxMonitorVersion -> LocalTxMonitorVersion -> LocalTxMonitorVersion # | |