clmimicry

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: GPL-3.0 Imports: 39 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"`

	// Node is the configuration for the node
	Node NodeConfig `yaml:"node"`

	// Events is the configuration for the events
	Events EventConfig `yaml:"events"`
}

func (*Config) CreateSinks

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

func (*Config) Validate

func (c *Config) Validate() error

type EventConfig added in v0.0.169

type EventConfig struct {
	RecvRPCEnabled              bool `yaml:"recvRpcEnabled" default:"false"`
	SendRPCEnabled              bool `yaml:"sendRpcEnabled" default:"false"`
	AddPeerEnabled              bool `yaml:"addPeerEnabled" default:"true"`
	RemovePeerEnabled           bool `yaml:"removePeerEnabled" default:"true"`
	ConnectedEnabled            bool `yaml:"connectedEnabled" default:"true"`
	DisconnectedEnabled         bool `yaml:"disconnectedEnabled" default:"true"`
	JoinEnabled                 bool `yaml:"joinEnabled" default:"true"`
	HandleMetadataEnabled       bool `yaml:"handleMetadataEnabled" default:"true"`
	HandleStatusEnabled         bool `yaml:"handleStatusEnabled" default:"true"`
	GossipSubBeaconBlockEnabled bool `yaml:"gossipSubBeaconBlockEnabled" default:"true"`
	GossipSubAttestationEnabled bool `yaml:"gossipSubAttestationEnabled" default:"true"`
	GossipSubBlobSidecarEnabled bool `yaml:"gossipSubBlobSidecarEnabled" default:"true"`
}

func (*EventConfig) Validate added in v0.0.169

func (e *EventConfig) Validate() error

type Metrics

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

func NewMetrics

func NewMetrics(namespace string) *Metrics

func (*Metrics) AddDecoratedEvent

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

type Mimicry

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

func New

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

func (*Mimicry) ServeMetrics

func (m *Mimicry) ServeMetrics(ctx context.Context) error

func (*Mimicry) ServePProf

func (m *Mimicry) ServePProf(ctx context.Context) error

func (*Mimicry) ServeProbe added in v0.0.163

func (m *Mimicry) ServeProbe(ctx context.Context) error

func (*Mimicry) Start

func (m *Mimicry) Start(ctx context.Context) error

type NodeConfig

type NodeConfig struct {
	// The private key for the libp2p host and local enode in hex format
	PrivateKeyStr string `yaml:"privateKeyStr" default:""`

	// General timeout when communicating with other network participants
	DialTimeout time.Duration `yaml:"dialTimeout" default:"5s"`

	// The address information of the local ethereuem [enode.Node].
	Devp2pHost string `yaml:"devp2pHost" default:"0.0.0.0"`
	Devp2pPort int    `yaml:"devp2pPort" default:"0"`

	// The address information of the local libp2p host
	Libp2pHost string `yaml:"libp2pHost" default:"0.0.0.0"`
	Libp2pPort int    `yaml:"libp2pPort" default:"0"`

	// The address information where the Beacon API or Prysm's custom API is accessible at
	PrysmHost     string `yaml:"prysmHost" default:"127.0.0.1"`
	PrysmPortHTTP int    `yaml:"prysmPortHttp" default:"3500"`
	PrysmPortGRPC int    `yaml:"prysmPortGrpc" default:"4000"`

	// The maximum number of peers our libp2p host can be connected to.
	MaxPeers int `yaml:"maxPeers" default:"30"`

	// Limits the number of concurrent connection establishment routines. When
	// we discover peers over discv5 and are not at our MaxPeers limit we try
	// to establish a connection to a peer. However, we limit the concurrency to
	// this DialConcurrency value.
	DialConcurrency int `yaml:"dialConcurrency" default:"16"`
}

func (*NodeConfig) AsHermesConfig

func (h *NodeConfig) AsHermesConfig() *hermes.NodeConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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