source

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RetryInterval      time.Duration           `yaml:"retryInterval" default:"60s"`
	NodeRecords        []string                `yaml:"nodeRecords"`
	TransactionFilters TransactionFilterConfig `yaml:"transactionFilters"`
}

func (*Config) Validate

func (c *Config) Validate() error

type Coordinator

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

func NewCoordinator

func NewCoordinator(config *Config, broadcast func(ctx context.Context, transactions *mimicry.Transactions) error, log logrus.FieldLogger) (*Coordinator, error)

func (*Coordinator) Start

func (c *Coordinator) Start(ctx context.Context) error

func (*Coordinator) Stop

func (c *Coordinator) Stop(ctx context.Context) error

type CoordinatorStatus

type CoordinatorStatus struct {
	ConnectedPeers    int
	DisconnectedPeers int
}

type Metrics

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

func NewMetrics

func NewMetrics(namespace string) *Metrics

func (*Metrics) SetPeers

func (m *Metrics) SetPeers(count int, status string)

type Peer

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

func NewPeer

func NewPeer(ctx context.Context, log logrus.FieldLogger, nodeRecord string, handler func(ctx context.Context, transactions *mimicry.Transactions) error, sharedCache *cache.SharedCache, txFilterConfig *TransactionFilterConfig) (*Peer, error)

func (*Peer) ExportTransactions

func (p *Peer) ExportTransactions(ctx context.Context, items []*common.Hash) error

func (*Peer) Start

func (p *Peer) Start(ctx context.Context) (<-chan error, error)

func (*Peer) Stop

func (p *Peer) Stop(ctx context.Context) error

type TransactionExporter

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

func NewTransactionExporter

func NewTransactionExporter(log logrus.FieldLogger, handler func(ctx context.Context, items []*common.Hash) error) (TransactionExporter, error)

func (TransactionExporter) ExportItems

func (t TransactionExporter) ExportItems(ctx context.Context, items []*common.Hash) error

func (TransactionExporter) Shutdown

func (t TransactionExporter) Shutdown(ctx context.Context) error

type TransactionFilterConfig

type TransactionFilterConfig struct {
	To   []string `yaml:"to"`
	From []string `yaml:"from"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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