Documentation ¶
Index ¶
- func GenerateNodes(cnt int) (map[uint64]*bls.SecretKey, map[uint64]*proto.Node)
- func ReportValidatorStatus(pk string, meta *beacon.ValidatorMetadata, logger *zap.Logger)
- func ShareFromValidatorAddedEvent(validatorAddedEvent abiparser.ValidatorAddedEvent, operatorPubKey string) (*validatorstorage.Share, *bls.SecretKey, error)
- func UpdateShareMetadata(share *validatorstorage.Share, bc beacon.Beacon) (bool, error)
- type Controller
- type ControllerOptions
- type Options
- type ShareEventHandlerFunc
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateNodes ¶
GenerateNodes generates randomly nodes
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 abiparser.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
func UpdateShareMetadata ¶ added in v0.1.5
UpdateShareMetadata will update the given share object w/o involving storage, it will be called only when a new share is created
Types ¶
type Controller ¶ added in v0.1.7
type Controller interface { ListenToEth1Events(feed *event.Feed) StartValidators() GetValidatorsIndices() []spec.ValidatorIndex GetValidator(pubKey string) (*Validator, bool) UpdateValidatorMetaDataLoop() StartNetworkMediators() Eth1EventHandler(handlers ...ShareEventHandlerFunc) eth1.SyncEventHandler }
Controller represent the validators controller, it takes care of bootstrapping, updating and managing existing validators and their shares
func NewController ¶
func NewController(options ControllerOptions) Controller
NewController creates a new validator controller instance
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 */ HistorySyncRateLimit time.Duration `yaml:"HistorySyncRateLimit" env:"HISTORY_SYNC_BACKOFF" env-default:"200ms" env-description:"Interval for updating metadata"` ETHNetwork *core.Network Network network.Network Beacon beacon.Beacon CleanRegistryData bool Fork forks.Fork KeyManager beacon.KeyManager OperatorPubKey string RegistryStorage registrystorage.OperatorsCollection }
ControllerOptions for creating a validator controller
type Options ¶
type Options struct { Context context.Context Logger *zap.Logger SignatureCollectionTimeout time.Duration Network network.Network Beacon beacon.Beacon ETHNetwork *core.Network DB basedb.IDb Fork forks.Fork Signer beacon.Signer SyncRateLimit time.Duration // contains filtered or unexported fields }
Options to add in validator struct creation
type ShareEventHandlerFunc ¶ added in v0.1.11
type ShareEventHandlerFunc func(share *validatorstorage.Share)
ShareEventHandlerFunc is a function that handles event in an extended mode
type Validator ¶
type Validator struct { // contains filtered or unexported fields }
Validator represents a running validator, it holds the corresponding ibft controllers to trigger consensus layer (see ExecuteDuty())
func New ¶
New creates a new validator instance and the corresponding ibft controller in addition, warms up beacon client and update operator ids owned by validator controller
func (*Validator) ExecuteDuty ¶
ExecuteDuty executes the given duty
func (*Validator) GetMsgResolver ¶ added in v0.1.9
func (v *Validator) GetMsgResolver(networkMsg network.NetworkMsg) func(msg *proto.SignedMessage)
GetMsgResolver returns proper handler for msg based on msg type