validator

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: GPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateNodes

func GenerateNodes(cnt int) (map[uint64]*bls.SecretKey, map[uint64]*proto.Node)

GenerateNodes generates randomly nodes

func ReportIBFTStatus added in v0.1.2

func ReportIBFTStatus(pk string, finished, errorFound bool)

ReportIBFTStatus reports the current iBFT status

func ReportValidatorStatus added in v0.0.20

func ReportValidatorStatus(pk string, meta *beacon.ValidatorMetadata, logger *zap.Logger)

ReportValidatorStatus reports the current status of validator

func ShareFromValidatorAddedEvent added in v0.0.4

func ShareFromValidatorAddedEvent(validatorAddedEvent eth1.ValidatorAddedEvent, operatorPubKey string) (*validatorstorage.Share, *bls.SecretKey, error)

ShareFromValidatorAddedEvent takes the contract event data and creates the corresponding validator share. share could return nil in case operator key is not present/ different

Types

type ControllerOptions

type ControllerOptions struct {
	Context                    context.Context
	DB                         basedb.IDb
	Logger                     *zap.Logger
	SignatureCollectionTimeout time.Duration `` /* 152-byte string literal not displayed */
	MetadataUpdateInterval     time.Duration `` /* 127-byte string literal not displayed */
	ETHNetwork                 *core.Network
	Network                    network.Network
	Beacon                     beacon.Beacon
	Shares                     []validatorstorage.ShareOptions `yaml:"Shares"`
	ShareEncryptionKeyProvider eth1.ShareEncryptionKeyProvider
	CleanRegistryData          bool
	Fork                       forks.Fork
	KeyManager                 beacon.KeyManager
}

ControllerOptions for creating a validator controller

type IController

type IController interface {
	ListenToEth1Events(cn pubsub.SubjectChannel)
	ProcessEth1Event(e eth1.Event) error
	StartValidators()
	GetValidatorsIndices() []spec.ValidatorIndex
	GetValidator(pubKey string) (*Validator, bool)
	UpdateValidatorMetaDataLoop()
}

IController represent the validators controller, it takes care of bootstrapping, updating and managing existing validators and their shares

func NewController

func NewController(options ControllerOptions) IController

NewController creates a new validator controller instance

type Options

type Options struct {
	Context                    context.Context
	Logger                     *zap.Logger
	Share                      *storage.Share
	SignatureCollectionTimeout time.Duration
	Network                    network.Network
	Beacon                     beacon.Beacon
	ETHNetwork                 *core.Network
	DB                         basedb.IDb
	Fork                       forks.Fork
	Signer                     beacon.Signer
}

Options to add in validator struct creation

type Validator

type Validator struct {
	Share *storage.Share
	// contains filtered or unexported fields
}

Validator struct that manages all ibft wrappers

func New

func New(opt Options) *Validator

New Validator creation

func (*Validator) ExecuteDuty

func (v *Validator) ExecuteDuty(ctx context.Context, slot uint64, duty *beacon.Duty)

ExecuteDuty executes the given duty

func (*Validator) Start

func (v *Validator) Start() error

Start validator

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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