mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-18 07:48:46 +00:00
4017743f7f
* refactoring create account * dep * much easier, create a derived account by simply unlocking wallet * revert changes to new * make open wallet smarter and utilize cli ctx * remove the wallet config * successfully build * simplify ctx creation for tests * tests should pass individually * tests pass * fixed up to allow for wallet password file input * fix broken tests * formatting * fmt * simplify recover * fixed up tests * implicit use of default wallet path working Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
65 lines
1.8 KiB
Go
65 lines
1.8 KiB
Go
package v2
|
|
|
|
import (
|
|
"github.com/prysmaticlabs/prysm/validator/flags"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
// WalletCommands for accounts-v2 for Prysm validators.
|
|
var WalletCommands = &cli.Command{
|
|
Name: "wallet-v2",
|
|
Category: "wallet-v2",
|
|
Usage: "defines commands for interacting with eth2 validator wallets (work in progress)",
|
|
Subcommands: []*cli.Command{
|
|
{
|
|
Name: "create",
|
|
Usage: "creates a new wallet with a desired type of keymanager: " +
|
|
"either on-disk (direct), derived, or using remote credentials",
|
|
Flags: []cli.Flag{
|
|
flags.WalletDirFlag,
|
|
flags.WalletPasswordsDirFlag,
|
|
flags.KeymanagerKindFlag,
|
|
flags.GrpcRemoteAddressFlag,
|
|
flags.RemoteSignerCertPathFlag,
|
|
flags.RemoteSignerKeyPathFlag,
|
|
flags.RemoteSignerCACertPathFlag,
|
|
flags.PasswordFileFlag,
|
|
},
|
|
Action: func(cliCtx *cli.Context) error {
|
|
if err := CreateWallet(cliCtx); err != nil {
|
|
log.WithError(err).Fatal("Could not create a wallet")
|
|
}
|
|
return nil
|
|
},
|
|
},
|
|
{
|
|
Name: "edit-config",
|
|
Usage: "edits a wallet configuration options, such as gRPC connection credentials and TLS certificates",
|
|
Flags: []cli.Flag{
|
|
flags.WalletDirFlag,
|
|
flags.GrpcRemoteAddressFlag,
|
|
flags.RemoteSignerCertPathFlag,
|
|
flags.RemoteSignerKeyPathFlag,
|
|
flags.RemoteSignerCACertPathFlag,
|
|
},
|
|
Action: func(cliCtx *cli.Context) error {
|
|
if err := EditWalletConfiguration(cliCtx); err != nil {
|
|
log.WithError(err).Fatal("Could not edit wallet configuration")
|
|
}
|
|
return nil
|
|
},
|
|
},
|
|
{
|
|
Name: "recover",
|
|
Usage: "uses a derived wallet seed recovery phase to recreate an existing HD wallet",
|
|
Flags: []cli.Flag{
|
|
flags.WalletDirFlag,
|
|
flags.WalletPasswordsDirFlag,
|
|
flags.MnemonicFileFlag,
|
|
flags.PasswordFileFlag,
|
|
},
|
|
Action: RecoverWallet,
|
|
},
|
|
},
|
|
}
|