Documentation
¶
Index ¶
- Constants
- type AddTransactionEvent
- type Mempool
- func (m *Mempool) AddConsumer(connId ouroboros.ConnectionId) *MempoolConsumer
- func (m *Mempool) AddTransaction(txType uint, txBytes []byte) error
- func (m *Mempool) Consumer(connId ouroboros.ConnectionId) *MempoolConsumer
- func (m *Mempool) GetTransaction(txHash string) (MempoolTransaction, bool)
- func (m *Mempool) RemoveConsumer(connId ouroboros.ConnectionId)
- func (m *Mempool) RemoveTransaction(txHash string)
- func (m *Mempool) Transactions() []MempoolTransaction
- type MempoolConfig
- type MempoolConsumer
- type MempoolFullError
- type MempoolTransaction
- type RemoveTransactionEvent
- type TxValidator
Constants ¶
View Source
const ( AddTransactionEventType event.EventType = "mempool.add_tx" RemoveTransactionEventType event.EventType = "mempool.remove_tx" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddTransactionEvent ¶
type Mempool ¶
func NewMempool ¶
func NewMempool(config MempoolConfig) *Mempool
func (*Mempool) AddConsumer ¶
func (m *Mempool) AddConsumer(connId ouroboros.ConnectionId) *MempoolConsumer
func (*Mempool) AddTransaction ¶
func (*Mempool) Consumer ¶
func (m *Mempool) Consumer(connId ouroboros.ConnectionId) *MempoolConsumer
func (*Mempool) GetTransaction ¶
func (m *Mempool) GetTransaction(txHash string) (MempoolTransaction, bool)
func (*Mempool) RemoveConsumer ¶
func (m *Mempool) RemoveConsumer(connId ouroboros.ConnectionId)
func (*Mempool) RemoveTransaction ¶
func (*Mempool) Transactions ¶ added in v0.2.2
func (m *Mempool) Transactions() []MempoolTransaction
type MempoolConfig ¶ added in v0.13.0
type MempoolConfig struct { MempoolCapacity int64 Logger *slog.Logger EventBus *event.EventBus PromRegistry prometheus.Registerer Validator TxValidator }
type MempoolConsumer ¶
type MempoolConsumer struct {
// contains filtered or unexported fields
}
func (*MempoolConsumer) ClearCache ¶
func (m *MempoolConsumer) ClearCache()
func (*MempoolConsumer) GetTxFromCache ¶
func (m *MempoolConsumer) GetTxFromCache(hash string) *MempoolTransaction
func (*MempoolConsumer) NextTx ¶
func (m *MempoolConsumer) NextTx(blocking bool) *MempoolTransaction
func (*MempoolConsumer) RemoveTxFromCache ¶
func (m *MempoolConsumer) RemoveTxFromCache(hash string)
type MempoolFullError ¶ added in v0.13.0
func (*MempoolFullError) Error ¶ added in v0.13.0
func (e *MempoolFullError) Error() string
type MempoolTransaction ¶
type RemoveTransactionEvent ¶
type RemoveTransactionEvent struct {
Hash string
}
type TxValidator ¶ added in v0.14.1
type TxValidator interface {
ValidateTx(tx gledger.Transaction) error
}
TxValidator defines the interface for transaction validation needed by mempool.
Click to show internal directories.
Click to hide internal directories.