validator

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: GPL-3.0 Imports: 31 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 IdentifierFormat added in v0.0.4

func IdentifierFormat(pubKey []byte, role beacon.RoleType) string

IdentifierFormat return base format for lambda

func ShareFromValidatorAddedEvent added in v0.0.4

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

ShareFromValidatorAddedEvent takes the contract event data and creates the corresponding validator share

Types

type ControllerOptions

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

ControllerOptions for controller struct creation

type IController

type IController interface {
	ListenToEth1Events(cn pubsub.SubjectChannel)
	StartValidators()
	GetValidatorsPubKeys() [][]byte
	GetValidatorsIndices() []spec.ValidatorIndex
	GetValidator(pubKey string) (*Validator, bool)
	NewValidatorSubject() pubsub.Subscriber
}

IController interface

func NewController

func NewController(options ControllerOptions) IController

NewController creates new validator controller

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
}

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, db basedb.IDb) *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) GetIBFT added in v0.0.6

func (v *Validator) GetIBFT(r beacon.RoleType) (ibft.IBFT, bool)

GetIBFT will return the IBFT of the corresponding role

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