sage

package
v0.0.181 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: GPL-3.0 Imports: 24 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 is the logging level to use.
	LoggingLevel string `yaml:"logging" default:"info"`
	// PProfAddr is the address to listen on for pprof.
	PProfAddr *string `yaml:"pprofAddr"`
	// MetricsAddr is the address to server prometheus metrics on.
	MetricsAddr string `yaml:"metricsAddr" default:":9093"`
	// Name is the name of the service.
	Name string `yaml:"name" default:"xatu-sage"`
	// Outputs configuration
	Outputs []output.Config `yaml:"outputs"`
	// ArmiarmaURL configuration
	ArmiarmaURL string `yaml:"armiarmaUrl"`
	// NTP Server to use for clock drift correction
	NTPServer string `yaml:"ntpServer" default:"time.google.com"`
	// Ethereum configuration
	Ethereum ethereum.Config `yaml:"ethereum"`
	// Workers is the number of workers to use for processing events.
	// Warning: Running more than 1 worker may result in more than $DUPLICATE_ATTESTATION_THRESHOLD
	// duplicate events being sent to outputs.
	Workers int `yaml:"workers" default:"1"`
	// DuplicateAttestationThreshold is the number of duplicate attestations to allow before
	// ignoring the event.
	DuplicateAttestationThreshold int `yaml:"duplicateAttestationThreshold" default:"3"`
}

func (*Config) Validate

func (c *Config) 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, network string)

type Sage

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

func New

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

func (*Sage) ServeMetrics

func (a *Sage) ServeMetrics(ctx context.Context) error

func (*Sage) ServePProf

func (a *Sage) ServePProf(ctx context.Context) error

func (*Sage) Start

func (a *Sage) Start(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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