standard

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameter

type Parameter interface {
	// contains filtered or unexported methods
}

Parameter is the interface for service parameters.

func WithClientMonitor

func WithClientMonitor(clientMonitor metrics.ClientMonitor) Parameter

WithClientMonitor sets the client monitor for the module.

func WithFarFutureEpoch

func WithFarFutureEpoch(farFutureEpoch phase0.Epoch) Parameter

WithFarFutureEpoch sets the far future epoch.

func WithLogLevel

func WithLogLevel(logLevel zerolog.Level) Parameter

WithLogLevel sets the log level for the module.

func WithMonitor

func WithMonitor(monitor metrics.ValidatorsManagerMonitor) Parameter

WithMonitor sets the monitor for the module.

func WithValidatorsProvider

func WithValidatorsProvider(provider eth2client.ValidatorsProvider) Parameter

WithValidatorsProvider sets the validator status provider.

type Service

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

Service is the manager for validators.

func New

func New(_ context.Context, params ...Parameter) (*Service, error)

New creates a new validator provider.

func (*Service) RefreshValidatorsFromBeaconNode

func (s *Service) RefreshValidatorsFromBeaconNode(ctx context.Context, pubKeys []phase0.BLSPubKey) error

RefreshValidatorsFromBeaconNode refreshes the local store from the beacon node. This is an expensive operation, and should not be called in the validating path.

func (*Service) ValidatorStateAtEpoch

func (s *Service) ValidatorStateAtEpoch(ctx context.Context, index phase0.ValidatorIndex, epoch phase0.Epoch) (api.ValidatorState, error)

ValidatorStateAtEpoch returns the validator's state at the given epoch.

func (*Service) ValidatorsByIndex

func (s *Service) ValidatorsByIndex(ctx context.Context, indices []phase0.ValidatorIndex) map[phase0.ValidatorIndex]*phase0.Validator

ValidatorsByIndex fetches the requested validators from local store given their indices.

func (*Service) ValidatorsByPubKey

func (s *Service) ValidatorsByPubKey(ctx context.Context, pubKeys []phase0.BLSPubKey) map[phase0.ValidatorIndex]*phase0.Validator

ValidatorsByPubKey fetches the requested validators from local store given their public keys.

Jump to

Keyboard shortcuts

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