Documentation ¶
Overview ¶
Package accounts defines a new model for accounts management in Prysm, using best practices for user security, UX, and extensibility via different wallet types including HD wallets, imported (non-HD) wallets, and remote-signing capable configurations. This model is compliant with the EIP-2333, EIP-2334, and EIP-2335 standards for key management in Ethereum.
Index ¶
- Variables
- func BackupAccountsCli(cliCtx *cli.Context) error
- func CreateAndSaveWalletCli(cliCtx *cli.Context) (*wallet.Wallet, error)
- func CreateWalletWithKeymanager(ctx context.Context, cfg *CreateWalletConfig) (*wallet.Wallet, error)
- func DeleteAccount(ctx context.Context, cfg *Config) error
- func DeleteAccountCli(cliCtx *cli.Context) error
- func EditWalletConfigurationCli(cliCtx *cli.Context) error
- func ExitAccountsCli(cliCtx *cli.Context, r io.Reader) error
- func ImportAccounts(ctx context.Context, cfg *ImportAccountsConfig) error
- func ImportAccountsCli(cliCtx *cli.Context) error
- func ListAccountsCli(cliCtx *cli.Context) error
- func PerformVoluntaryExit(ctx context.Context, cfg PerformExitCfg) (rawExitedKeys [][]byte, formattedExitedKeys []string, err error)
- func RecoverWallet(ctx context.Context, cfg *RecoverWalletConfig) (*wallet.Wallet, error)
- func RecoverWalletCli(cliCtx *cli.Context) error
- func ValidateMnemonic(mnemonic string) error
- type Config
- type CreateWalletConfig
- type ImportAccountsConfig
- type PerformExitCfg
- type RecoverWalletConfig
Constants ¶
This section is empty.
Variables ¶
var (
// ErrCouldNotInitializeKeymanager informs about failed keymanager initialization
ErrCouldNotInitializeKeymanager = "could not initialize keymanager"
)
Functions ¶
func BackupAccountsCli ¶
func BackupAccountsCli(cliCtx *cli.Context) error
BackupAccountsCli allows users to select validator accounts from their wallet and export them as a backup.zip file containing the keys as EIP-2335 compliant keystore.json files, which are compatible with importing in other Ethereum consensus clients.
func CreateAndSaveWalletCli ¶
CreateAndSaveWalletCli from user input with a desired keymanager. If a wallet already exists in the path, it suggests the user alternatives such as how to edit their existing wallet configuration.
func CreateWalletWithKeymanager ¶
func CreateWalletWithKeymanager(ctx context.Context, cfg *CreateWalletConfig) (*wallet.Wallet, error)
CreateWalletWithKeymanager specified by configuration options.
func DeleteAccount ¶
DeleteAccount deletes the accounts that the user requests to be deleted from the wallet.
func DeleteAccountCli ¶
func DeleteAccountCli(cliCtx *cli.Context) error
DeleteAccountCli deletes the accounts that the user requests to be deleted from the wallet. This function uses the CLI to extract necessary values.
func EditWalletConfigurationCli ¶
func EditWalletConfigurationCli(cliCtx *cli.Context) error
EditWalletConfigurationCli for a user's on-disk wallet, being able to change things such as remote gRPC credentials for remote signing, derivation paths for HD wallets, and more.
func ExitAccountsCli ¶
ExitAccountsCli performs a voluntary exit on one or more accounts.
func ImportAccounts ¶
func ImportAccounts(ctx context.Context, cfg *ImportAccountsConfig) error
ImportAccounts can import external, EIP-2335 compliant keystore.json files as new accounts into the Prysm validator wallet.
func ImportAccountsCli ¶
func ImportAccountsCli(cliCtx *cli.Context) error
ImportAccountsCli can import external, EIP-2335 compliant keystore.json files as new accounts into the Prysm validator wallet. This uses the CLI to extract values necessary to run the function.
func ListAccountsCli ¶
func ListAccountsCli(cliCtx *cli.Context) error
ListAccountsCli displays all available validator accounts in a Prysm wallet.
func PerformVoluntaryExit ¶
func PerformVoluntaryExit( ctx context.Context, cfg PerformExitCfg, ) (rawExitedKeys [][]byte, formattedExitedKeys []string, err error)
PerformVoluntaryExit uses gRPC clients to submit a voluntary exit message to a beacon node.
func RecoverWallet ¶
RecoverWallet uses a menmonic seed phrase to recover a wallet into the path provided.
func RecoverWalletCli ¶
func RecoverWalletCli(cliCtx *cli.Context) error
RecoverWalletCli uses a menmonic seed phrase to recover a wallet into the path provided. This uses the CLI to extract necessary values to run the function.
func ValidateMnemonic ¶
ValidateMnemonic ensures that it is not empty and that the count of the words are as specified(currently 24).
Types ¶
type Config ¶
type Config struct { Wallet *wallet.Wallet Keymanager keymanager.IKeymanager DeletePublicKeys [][]byte }
Config specifies parameters for accounts commands.
type CreateWalletConfig ¶
type CreateWalletConfig struct { SkipMnemonicConfirm bool NumAccounts int RemoteKeymanagerOpts *remote.KeymanagerOpts WalletCfg *wallet.Config Mnemonic25thWord string }
CreateWalletConfig defines the parameters needed to call the create wallet functions.
type ImportAccountsConfig ¶
type ImportAccountsConfig struct { Keystores []*keymanager.Keystore Keymanager *imported.Keymanager AccountPassword string }
ImportAccountsConfig defines values to run the import accounts function.
type PerformExitCfg ¶
type PerformExitCfg struct { ValidatorClient ethpb.BeaconNodeValidatorClient NodeClient ethpb.NodeClient Keymanager keymanager.IKeymanager RawPubKeys [][]byte FormattedPubKeys []string }
PerformExitCfg for account voluntary exits.