Documentation ¶
Index ¶
- Constants
- func CheckAndUpgradeWallet(walletDataPath string, nextAccountPath string, logger *slog.Logger) (bool, error)
- func StopValidator(ctx context.Context, cfg *config.SmartNodeConfig, bc beacon.IBeaconClient, ...) error
- type ValidatorKey
- type ValidatorManager
- func (m *ValidatorManager) CheckForAndRecoverCustomMinipoolKeys(pubkeyMap map[beacon.ValidatorPubkey]bool, testOnly bool) (map[beacon.ValidatorPubkey]bool, error)
- func (m *ValidatorManager) GetNextValidatorKey(save bool) (*eth2types.BLSPrivateKey, uint64, error)
- func (m *ValidatorManager) GetValidatorKeyAt(index uint64) (*eth2types.BLSPrivateKey, error)
- func (m *ValidatorManager) GetValidatorKeyCount() (uint64, error)
- func (m *ValidatorManager) GetValidatorKeys(startIndex uint64, length uint64) ([]ValidatorKey, error)
- func (m *ValidatorManager) LoadValidatorKey(pubkey beacon.ValidatorPubkey) (*eth2types.BLSPrivateKey, error)
- func (m *ValidatorManager) RecoverMinipoolKeys(testOnly bool) ([]beacon.ValidatorPubkey, error)
- func (m *ValidatorManager) RecoverValidatorKey(pubkey beacon.ValidatorPubkey, startIndex uint64) (uint64, error)
- func (m *ValidatorManager) SaveValidatorKey(key ValidatorKey) error
- func (m *ValidatorManager) StoreValidatorKey(key *eth2types.BLSPrivateKey, path string) error
- func (m *ValidatorManager) TestRecoverValidatorKey(pubkey beacon.ValidatorPubkey, startIndex uint64) (uint64, error)
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
Click to show internal directories.
Click to hide internal directories.