Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeKeyStore ¶
type FakeKeyStore struct{}
FakeKeyStore should be assumed to be insecure.
func NewFakeKeyStore ¶
func NewFakeKeyStore() FakeKeyStore
NewFakeKeyStore creates a new fake key store.
func (FakeKeyStore) GetKeyForValidator ¶
func (f FakeKeyStore) GetKeyForValidator(v uint32) *bls.SecretKey
GetKeyForValidator gets the private key for the given validator ID.
func (FakeKeyStore) GetPublicKeyForValidator ¶
func (f FakeKeyStore) GetPublicKeyForValidator(v uint32) *bls.PublicKey
GetPublicKeyForValidator gets the public key for the given validator ID.
type HDReader ¶
type HDReader struct {
// contains filtered or unexported fields
}
HDReader is a random reader from a hash.
func GetReaderForID ¶
GetReaderForID gets a reader for a specific root key and validator ID.
type Keystore ¶
type Keystore interface { GetKeyForValidator(uint32) *bls.SecretKey GetPublicKeyForValidator(uint32) *bls.PublicKey }
Keystore is an interface for retrieving keys from a keystore.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is a manager that keeps track of multiple validators.
func NewManager ¶
func NewManager(ctx context.Context, blockchainRPC pb.BlockchainRPCClient, validators []uint32, keystore Keystore, c *config.Config) (*Manager, error)
NewManager creates a new validator manager to manage some validators.
func (*Manager) ListenForBlockAndCycle ¶
ListenForBlockAndCycle listens for any new blocks or cycles and relays the information to validators.
func (*Manager) UpdateSlotNumber ¶
UpdateSlotNumber gets the slot number from RPC and runs validator actions as needed.
type RootKeyStore ¶
type RootKeyStore struct {
// contains filtered or unexported fields
}
RootKeyStore is a keystore where each validator is derived from a specific root key.
func NewRootKeyStore ¶
func NewRootKeyStore(rootKey string) *RootKeyStore
NewRootKeyStore gets a new root key store from the root key.
func (*RootKeyStore) GetKeyForValidator ¶
func (k *RootKeyStore) GetKeyForValidator(validatorID uint32) *bls.SecretKey
GetKeyForValidator gets a private key for a validator ID.
func (*RootKeyStore) GetPublicKeyForValidator ¶
func (k *RootKeyStore) GetPublicKeyForValidator(validatorID uint32) *bls.PublicKey
GetPublicKeyForValidator gets a public key for a validator ID.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator is a single validator to keep track of
func NewValidator ¶
func NewValidator(ctx context.Context, keystore Keystore, blockchainRPC pb.BlockchainRPCClient, id uint32, c *config.Config, f *primitives.ForkData) (*Validator, error)
NewValidator gets a validator
func (*Validator) RunValidator ¶
RunValidator keeps track of assignments and creates/signs attestations as needed.