Documentation
¶
Index ¶
- func GenerateNodes(cnt int) (map[spectypes.OperatorID]*bls.SecretKey, map[spectypes.OperatorID]*beacon.Node)
- func NewTestKeyManager() spectypes.KeyManager
- func ReportValidatorStatus(pk string, meta *beaconprotocol.ValidatorMetadata, logger *zap.Logger)
- type ICollection
- type IValidator
- type Options
- type TestBeacon
- func (b *TestBeacon) AddShare(shareKey *bls.SecretKey) error
- func (b *TestBeacon) ComputeSigningRoot(object interface{}, domain []byte) ([32]byte, error)
- func (b *TestBeacon) GetAttestationData(slot spec.Slot, committeeIndex spec.CommitteeIndex) (*spec.AttestationData, error)
- func (b *TestBeacon) GetDomain(data *spec.AttestationData) ([]byte, error)
- func (b *TestBeacon) GetDuties(epoch spec.Epoch, validatorIndices []spec.ValidatorIndex) ([]*spectypes.Duty, error)
- func (b *TestBeacon) GetValidatorData(validatorPubKeys []spec.BLSPubKey) (map[spec.ValidatorIndex]*api.Validator, error)
- func (b *TestBeacon) RemoveShare(pubKey string) error
- func (b *TestBeacon) SignRoot(data spectypes.Root, sigType spectypes.SignatureType, pk []byte) (spectypes.Signature, error)
- func (b *TestBeacon) StartReceivingBlocks()
- func (b *TestBeacon) SubmitAttestation(attestation *spec.Attestation) error
- func (b *TestBeacon) SubscribeToCommitteeSubnet(subscription []*api.BeaconCommitteeSubscription) error
- type Validator
- func (v *Validator) Close() error
- func (v *Validator) GetShare() *beaconprotocol.Share
- func (v *Validator) Ibfts() controller.Controllers
- func (v *Validator) OnFork(forkVersion forksprotocol.ForkVersion) error
- func (v *Validator) ProcessMsg(msg *spectypes.SSVMessage) error
- func (v *Validator) Start() error
- func (v *Validator) StartDuty(duty *spectypes.Duty)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateNodes ¶
func GenerateNodes(cnt int) (map[spectypes.OperatorID]*bls.SecretKey, map[spectypes.OperatorID]*beacon.Node)
GenerateNodes generates randomly nodes
func NewTestKeyManager ¶ added in v0.3.0
func NewTestKeyManager() spectypes.KeyManager
NewTestKeyManager creates a new ssvSigner for tests
func ReportValidatorStatus ¶
func ReportValidatorStatus(pk string, meta *beaconprotocol.ValidatorMetadata, logger *zap.Logger)
ReportValidatorStatus reports the current status of validator
Types ¶
type ICollection ¶
type ICollection interface {
eth1.RegistryStore
}
ICollection interface for validator storage
type IValidator ¶
type IValidator interface {
Start() error
StartDuty(duty *spectypes.Duty)
ProcessMsg(msg *spectypes.SSVMessage) error // TODO need to be as separate interface?
forksprotocol.ForkHandler
io.Closer
}
IValidator is the interface for validator
type Options ¶
type Options struct {
Context context.Context
Logger *zap.Logger
IbftStorage qbftstorage.QBFTStore
Network beaconprotocol.Network
P2pNetwork p2pprotocol.Network
Beacon beaconprotocol.Beacon
ForkVersion forksprotocol.ForkVersion
KeyManager spectypes.KeyManager
SyncRateLimit time.Duration
SignatureCollectionTimeout time.Duration
MinPeers int
ReadMode bool
FullNode bool
NewDecidedHandler controller.NewDecidedHandler
DutyRoles []spectypes.BeaconRole
}
Options is the validator options
type TestBeacon ¶ added in v0.3.0
type TestBeacon struct {
LastSubmittedAttestation *spec.Attestation
KeyManager spectypes.KeyManager
// contains filtered or unexported fields
}
TestBeacon implement beacon
func NewTestBeacon ¶ added in v0.3.0
func NewTestBeacon(t *testing.T) *TestBeacon
NewTestBeacon returns TestBeacon struct
func (*TestBeacon) AddShare ¶ added in v0.3.0
func (b *TestBeacon) AddShare(shareKey *bls.SecretKey) error
AddShare impl
func (*TestBeacon) ComputeSigningRoot ¶ added in v0.3.0
func (b *TestBeacon) ComputeSigningRoot(object interface{}, domain []byte) ([32]byte, error)
ComputeSigningRoot impl
func (*TestBeacon) GetAttestationData ¶ added in v0.3.0
func (b *TestBeacon) GetAttestationData(slot spec.Slot, committeeIndex spec.CommitteeIndex) (*spec.AttestationData, error)
GetAttestationData impl
func (*TestBeacon) GetDomain ¶ added in v0.3.0
func (b *TestBeacon) GetDomain(data *spec.AttestationData) ([]byte, error)
GetDomain impl
func (*TestBeacon) GetDuties ¶ added in v0.3.0
func (b *TestBeacon) GetDuties(epoch spec.Epoch, validatorIndices []spec.ValidatorIndex) ([]*spectypes.Duty, error)
GetDuties impl
func (*TestBeacon) GetValidatorData ¶ added in v0.3.0
func (b *TestBeacon) GetValidatorData(validatorPubKeys []spec.BLSPubKey) (map[spec.ValidatorIndex]*api.Validator, error)
GetValidatorData impl
func (*TestBeacon) RemoveShare ¶ added in v0.3.0
func (b *TestBeacon) RemoveShare(pubKey string) error
RemoveShare impl
func (*TestBeacon) SignRoot ¶ added in v0.3.0
func (b *TestBeacon) SignRoot(data spectypes.Root, sigType spectypes.SignatureType, pk []byte) (spectypes.Signature, error)
SignRoot impl
func (*TestBeacon) StartReceivingBlocks ¶ added in v0.3.0
func (b *TestBeacon) StartReceivingBlocks()
StartReceivingBlocks iml
func (*TestBeacon) SubmitAttestation ¶ added in v0.3.0
func (b *TestBeacon) SubmitAttestation(attestation *spec.Attestation) error
SubmitAttestation impl
func (*TestBeacon) SubscribeToCommitteeSubnet ¶ added in v0.3.0
func (b *TestBeacon) SubscribeToCommitteeSubnet(subscription []*api.BeaconCommitteeSubscription) error
SubscribeToCommitteeSubnet impl
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator represents the validator
func (*Validator) GetShare ¶
func (v *Validator) GetShare() *beaconprotocol.Share
GetShare returns the validator share
func (*Validator) Ibfts ¶
func (v *Validator) Ibfts() controller.Controllers
Ibfts returns the ibft controllers
func (*Validator) OnFork ¶
func (v *Validator) OnFork(forkVersion forksprotocol.ForkVersion) error
OnFork updates all QFBT controllers with the new fork version
func (*Validator) ProcessMsg ¶
func (v *Validator) ProcessMsg(msg *spectypes.SSVMessage) error
ProcessMsg processes a new msg