validator

package
v2.0.0-b2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: GPL-3.0 Imports: 35 Imported by: 6

Documentation

Index

Constants

View Source
const (
	MaxValidatorKeyRecoverAttempts uint64 = 1000
)

Config

View Source
const (
	ValidatorKeyPath string = "m/12381/3600/%d/0/0"
)

Config

Variables

This section is empty.

Functions

func CheckAndUpgradeWallet

func CheckAndUpgradeWallet(walletDataPath string, nextAccountPath string, logger *slog.Logger) (bool, error)

Check for a legacy wallet and upgrade it if necessary, returning true if an upgrade was performed

func StopValidator

func StopValidator(ctx context.Context, cfg *config.SmartNodeConfig, bc beacon.IBeaconClient, d *client.Client, restart bool) error

Stop or restart the validator client

Types

type ValidatorKey

type ValidatorKey struct {
	PublicKey      beacon.ValidatorPubkey
	PrivateKey     *eth2types.BLSPrivateKey
	DerivationPath string
	WalletIndex    uint64
}

A validator private/public key pair

type ValidatorManager

type ValidatorManager struct {
	// contains filtered or unexported fields
}

Wallet management

func NewValidatorManager

func NewValidatorManager(cfg *config.SmartNodeConfig, rp *rocketpool.RocketPool, walletImpl *wallet.Wallet, queryMgr *eth.QueryManager) (*ValidatorManager, error)

func (*ValidatorManager) CheckForAndRecoverCustomMinipoolKeys

func (m *ValidatorManager) CheckForAndRecoverCustomMinipoolKeys(pubkeyMap map[beacon.ValidatorPubkey]bool, testOnly bool) (map[beacon.ValidatorPubkey]bool, error)

func (*ValidatorManager) GetNextValidatorKey

func (m *ValidatorManager) GetNextValidatorKey(save bool) (*eth2types.BLSPrivateKey, uint64, error)

Returns the next validator key to generate, optionally saving it

func (*ValidatorManager) GetValidatorKeyAt

func (m *ValidatorManager) GetValidatorKeyAt(index uint64) (*eth2types.BLSPrivateKey, error)

Get a validator key by index

func (*ValidatorManager) GetValidatorKeyCount

func (m *ValidatorManager) GetValidatorKeyCount() (uint64, error)

Get the number of validator keys recorded in the wallet

func (*ValidatorManager) GetValidatorKeys

func (m *ValidatorManager) GetValidatorKeys(startIndex uint64, length uint64) ([]ValidatorKey, error)

Recover a set of validator keys by their public key

func (*ValidatorManager) LoadValidatorKey

func (m *ValidatorManager) LoadValidatorKey(pubkey beacon.ValidatorPubkey) (*eth2types.BLSPrivateKey, error)

Loads a validator key from the wallet's keystores

func (*ValidatorManager) RecoverMinipoolKeys

func (m *ValidatorManager) RecoverMinipoolKeys(testOnly bool) ([]beacon.ValidatorPubkey, error)

func (*ValidatorManager) RecoverValidatorKey

func (m *ValidatorManager) RecoverValidatorKey(pubkey beacon.ValidatorPubkey, startIndex uint64) (uint64, error)

Recover a validator key by public key

func (*ValidatorManager) SaveValidatorKey

func (m *ValidatorManager) SaveValidatorKey(key ValidatorKey) error

Save a validator key

func (*ValidatorManager) StoreValidatorKey

func (m *ValidatorManager) StoreValidatorKey(key *eth2types.BLSPrivateKey, path string) error

Stores a validator key into all of the wallet's keystores

func (*ValidatorManager) TestRecoverValidatorKey

func (m *ValidatorManager) TestRecoverValidatorKey(pubkey beacon.ValidatorPubkey, startIndex uint64) (uint64, error)

Test recovery of a validator key by public key

Jump to

Keyboard shortcuts

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