Documentation ¶
Overview ¶
Package accounts defines tools to manage an encrypted validator keystore.
Index ¶
- func ChangePassword(keystorePath string, oldPassword string, newPassword string) error
- func CreateValidatorAccount(path string, passphrase string) (string, string, error)
- func DecryptKeysFromKeystore(directory string, filePrefix string, password string) (map[string]*keystore.Key, error)
- func DefaultValidatorDir() string
- func Exists(keystorePath string, assertNonEmpty bool) (bool, error)
- func ExtractPublicKeysFromKeyStore(keystorePath string, passphrase string) ([][]byte, error)
- func HandleEmptyKeystoreFlags(cliCtx *cli.Context, confirmPassword bool) (string, string, error)
- func Merge(ctx context.Context, sourceDirectories []string, targetDirectory string) (err error)
- func NewValidatorAccount(directory string, password string) error
- func PrintPublicAndPrivateKeys(path string, passphrase string) error
- func RunStatusCommand(ctx context.Context, pubKeys [][]byte, ...) error
- func Split(ctx context.Context, sourceDirectory string, targetDirectory string) (err error)
- func VerifyAccountNotExists(directory string, password string) error
- type ValidatorStatusMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangePassword ¶
ChangePassword changes the password for all keys located in a keystore. Password is changed only for keys that can be decrypted using the old password.
func CreateValidatorAccount ¶
CreateValidatorAccount creates a validator account from the given cli context.
func DecryptKeysFromKeystore ¶
func DecryptKeysFromKeystore(directory string, filePrefix string, password string) (map[string]*keystore.Key, error)
DecryptKeysFromKeystore extracts a set of validator private keys from an encrypted keystore directory and a password string.
func DefaultValidatorDir ¶
func DefaultValidatorDir() string
DefaultValidatorDir returns OS-specific default keystore directory.
func Exists ¶
Exists checks if a validator account at a given keystore path exists. assertNonEmpty is a boolean used to determine whether to check that the provided directory exists.
func ExtractPublicKeysFromKeyStore ¶
ExtractPublicKeysFromKeyStore extracts only the public keys from the decrypted keys from the keystore.
func HandleEmptyKeystoreFlags ¶
HandleEmptyKeystoreFlags checks what the set flags are and allows the user to manually enter them if they're empty.
func Merge ¶
Merge merges data from validator databases in sourceDirectories into a new store, which is created in targetDirectory.
func NewValidatorAccount ¶
NewValidatorAccount sets up a validator client's secrets and generates the necessary deposit data parameters needed to deposit into the deposit contract on the ETH1.0 chain. Specifically, this generates a BLS private and public key, and then logs the serialized deposit input hex string to be used in an ETH1.0 transaction by the validator.
func PrintPublicAndPrivateKeys ¶
PrintPublicAndPrivateKeys uses the passed in path and prints out the public and private keys in that directory.
func RunStatusCommand ¶
func RunStatusCommand(ctx context.Context, pubKeys [][]byte, beaconNodeRPCProvider ethpb.BeaconNodeValidatorClient) error
RunStatusCommand is the entry point to the `validator status` command.
func Split ¶
Split splits data from one validator database in sourceDirectory into several validator databases. Each validator database is created in its own subdirectory inside targetDirectory.
func VerifyAccountNotExists ¶
VerifyAccountNotExists checks if a validator has not yet created an account and keystore in the provided directory string.
Types ¶
type ValidatorStatusMetadata ¶
type ValidatorStatusMetadata struct { PublicKey []byte Index uint64 Metadata *ethpb.ValidatorStatusResponse }
ValidatorStatusMetadata holds all status information about a validator.
func FetchAccountStatuses ¶
func FetchAccountStatuses( ctx context.Context, beaconClient ethpb.BeaconNodeValidatorClient, pubKeys [][]byte, ) ([]ValidatorStatusMetadata, error)
FetchAccountStatuses fetches validator statuses from the BeaconNodeValidatorClient for each validator public key.