prysm-pulse/validator/accounts/v2/cmd_wallet.go
Ivan Martinez 6351d187ef
Accounts V2: Remove unused passwords-dir and deprecate flag (#6916)
* Remove passwords dir
* Deprecate flag
* Merge branch 'master' of github.com:prysmaticlabs/prysm into remove-passwords-dir
* Properly deprecate flag
* Merge branch 'master' into remove-passwords-dir
* Merge refs/heads/master into remove-passwords-dir
* Merge refs/heads/master into remove-passwords-dir
2020-08-07 00:02:30 +00:00

79 lines
2.3 KiB
Go

package v2
import (
"github.com/prysmaticlabs/prysm/shared/featureconfig"
"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.KeymanagerKindFlag,
flags.GrpcRemoteAddressFlag,
flags.RemoteSignerCertPathFlag,
flags.RemoteSignerKeyPathFlag,
flags.RemoteSignerCACertPathFlag,
flags.WalletPasswordFileFlag,
featureconfig.AltonaTestnet,
featureconfig.OnyxTestnet,
flags.DeprecatedPasswordsDirFlag,
},
Action: func(cliCtx *cli.Context) error {
if _, err := CreateWallet(cliCtx); err != nil {
log.Fatalf("Could not create a wallet: %v", err)
}
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,
featureconfig.AltonaTestnet,
featureconfig.OnyxTestnet,
flags.DeprecatedPasswordsDirFlag,
},
Action: func(cliCtx *cli.Context) error {
if err := EditWalletConfiguration(cliCtx); err != nil {
log.Fatalf("Could not edit wallet configuration: %v", err)
}
return nil
},
},
{
Name: "recover",
Usage: "uses a derived wallet seed recovery phase to recreate an existing HD wallet",
Flags: []cli.Flag{
flags.WalletDirFlag,
flags.MnemonicFileFlag,
flags.WalletPasswordFileFlag,
flags.NumAccountsFlag,
featureconfig.AltonaTestnet,
featureconfig.OnyxTestnet,
flags.DeprecatedPasswordsDirFlag,
},
Action: func(cliCtx *cli.Context) error {
if err := RecoverWallet(cliCtx); err != nil {
log.Fatalf("Could not recover wallet: %v", err)
}
return nil
},
},
},
}