relaymonitor

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: GPL-3.0 Imports: 32 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 {
	LoggingLevel string  `yaml:"logging" default:"info"`
	MetricsAddr  string  `yaml:"metricsAddr" default:":9090"`
	PProfAddr    *string `yaml:"pprofAddr"`
	ProbeAddr    *string `yaml:"probeAddr"`

	// The name of the mimicry
	Name string `yaml:"name"`

	// Ethereum configuration
	Ethereum ethereum.Config `yaml:"ethereum"`

	// Outputs configuration
	Outputs []output.Config `yaml:"outputs"`

	// Labels configures the mimicry with labels
	Labels map[string]string `yaml:"labels"`

	// NTP Server to use for clock drift correction
	NTPServer string `yaml:"ntpServer" default:"time.google.com"`

	Schedule Schedule `yaml:"schedule"`

	Relays []relay.Config `yaml:"relays"`

	FetchProposerPayloadDelivered bool `yaml:"fetchProposerPayloadDelivered" default:"true"`
}

func (*Config) CreateSinks

func (c *Config) CreateSinks(log logrus.FieldLogger) ([]output.Sink, error)

func (*Config) Validate

func (c *Config) Validate() error

type DuplicateBidCache

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

DuplicateBidCache is a cache to store information about whether a relay has seen a block for a specific slot and block hash

func NewDuplicateBidCache

func NewDuplicateBidCache(ttl time.Duration) *DuplicateBidCache

NewDuplicateBidCache creates a new DuplicateBidCache with a specified TTL

func (*DuplicateBidCache) Has

func (dc *DuplicateBidCache) Has(relay string, slot phase0.Slot, blockHash string) bool

Has checks if a block hash has been seen for a specific relay and slot

func (*DuplicateBidCache) Set

func (dc *DuplicateBidCache) Set(relay string, slot phase0.Slot, blockHash string)

Set marks a block hash as seen for a specific relay and slot

type Metrics

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

func NewMetrics

func NewMetrics(namespace, networkName string) *Metrics

func (*Metrics) AddDecoratedEvent

func (m *Metrics) AddDecoratedEvent(count int, eventType string)

type RelayMonitor

type RelayMonitor struct {
	Config *Config
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, log logrus.FieldLogger, config *Config) (*RelayMonitor, error)

func (*RelayMonitor) ServeMetrics

func (r *RelayMonitor) ServeMetrics(ctx context.Context) error

func (*RelayMonitor) ServePProf

func (r *RelayMonitor) ServePProf(ctx context.Context) error

func (*RelayMonitor) ServeProbe

func (r *RelayMonitor) ServeProbe(ctx context.Context) error

func (*RelayMonitor) Start

func (r *RelayMonitor) Start(ctx context.Context) error

type Schedule

type Schedule struct {
	AtSlotTimes []human.Duration `yaml:"atSlotTimes"`
}

func (*Schedule) Validate

func (s *Schedule) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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