mempool

package
v0.39.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromCmdlineOptions

func NewFromCmdlineOptions() plugin.Plugin

Types

type Mempool

type Mempool struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...MempoolOptionFunc) *Mempool

New returns a new Mempool input plugin

func (*Mempool) ErrorChan

func (m *Mempool) ErrorChan() <-chan error

ErrorChan returns the plugin's error channel

func (*Mempool) InputChan

func (m *Mempool) InputChan() chan<- event.Event

InputChan returns nil (mempool is an input-only plugin)

func (*Mempool) OutputChan

func (m *Mempool) OutputChan() <-chan event.Event

OutputChan returns the channel of mempool transaction events

func (*Mempool) Start

func (m *Mempool) Start() error

Start connects to the node and starts polling the mempool. Safe to call again to restart (e.g. when the pipeline is restarted via Stop() then Start()). Event and error channels are reused when non-nil so that the pipeline's goroutines reading from OutputChan()/ErrorChan() never see a closed channel; after Stop() they are nil so the next Start() creates new channels and the pipeline obtains fresh references.

func (*Mempool) Stop

func (m *Mempool) Stop() error

Stop shuts down the connection and stops polling. Idempotent and safe to call multiple times, following the Pipeline's pattern (pipeline/pipeline.go): shutdown logic runs inside sync.Once so multiple Stop() calls never double-close channels.

type MempoolOptionFunc

type MempoolOptionFunc func(*Mempool)

func WithAddress

func WithAddress(address string) MempoolOptionFunc

WithAddress specifies the TCP address (host:port). Use WithNtcTcp(true) for NtC over TCP.

func WithIncludeCbor

func WithIncludeCbor(includeCbor bool) MempoolOptionFunc

WithIncludeCbor specifies whether to include transaction CBOR in events

func WithKupoUrl

func WithKupoUrl(kupoUrl string) MempoolOptionFunc

WithKupoUrl specifies the Kupo API URL for resolving transaction inputs (e.g. http://localhost:1442).

func WithLogger

func WithLogger(logger plugin.Logger) MempoolOptionFunc

WithLogger specifies the logger to use

func WithNetwork

func WithNetwork(network string) MempoolOptionFunc

WithNetwork specifies the network name (e.g. mainnet, preprod)

func WithNetworkMagic

func WithNetworkMagic(networkMagic uint32) MempoolOptionFunc

WithNetworkMagic specifies the network magic value (overrides network name)

func WithNtcTcp

func WithNtcTcp(ntcTcp bool) MempoolOptionFunc

WithNtcTcp specifies whether to use NtC over TCP (e.g. when exposing socket via socat)

func WithPollInterval

func WithPollInterval(duration string) MempoolOptionFunc

WithPollInterval specifies how often to poll the mempool (e.g. "5s", "1m"). Default 5s.

func WithSocketPath

func WithSocketPath(socketPath string) MempoolOptionFunc

WithSocketPath specifies the path to the node's UNIX socket (NtC)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL