2020-07-14 00:58:06 +00:00
|
|
|
package v2
|
|
|
|
|
|
|
|
import (
|
2020-07-16 05:08:16 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/validator/flags"
|
2020-07-14 00:58:06 +00:00
|
|
|
"github.com/urfave/cli/v2"
|
|
|
|
)
|
|
|
|
|
2020-07-15 04:05:21 +00:00
|
|
|
// WalletCommands for accounts-v2 for Prysm validators.
|
|
|
|
var WalletCommands = &cli.Command{
|
2020-07-14 00:58:06 +00:00
|
|
|
Name: "wallet-v2",
|
|
|
|
Category: "wallet-v2",
|
|
|
|
Usage: "defines commands for interacting with eth2 validator wallets (work in progress)",
|
|
|
|
Subcommands: []*cli.Command{
|
|
|
|
{
|
2020-07-15 04:05:21 +00:00
|
|
|
Name: "create",
|
|
|
|
Usage: "creates a new wallet with a desired type of keymanager: " +
|
|
|
|
"either on-disk (direct), derived, or using remote credentials",
|
2020-07-17 08:21:16 +00:00
|
|
|
Flags: []cli.Flag{
|
|
|
|
flags.WalletDirFlag,
|
|
|
|
flags.WalletPasswordsDirFlag,
|
|
|
|
flags.KeymanagerKindFlag,
|
|
|
|
flags.GrpcRemoteAddressFlag,
|
|
|
|
flags.RemoteSignerCertPathFlag,
|
|
|
|
flags.RemoteSignerKeyPathFlag,
|
|
|
|
flags.RemoteSignerCACertPathFlag,
|
|
|
|
},
|
2020-07-22 02:04:08 +00:00
|
|
|
Action: func(cliCtx *cli.Context) error {
|
|
|
|
if err := CreateWallet(cliCtx); err != nil {
|
|
|
|
log.WithError(err).Fatal("Could not create a wallet")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
},
|
2020-07-14 00:58:06 +00:00
|
|
|
},
|
2020-07-16 05:08:16 +00:00
|
|
|
{
|
|
|
|
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,
|
|
|
|
},
|
2020-07-22 02:04:08 +00:00
|
|
|
Action: func(cliCtx *cli.Context) error {
|
|
|
|
if err := EditWalletConfiguration(cliCtx); err != nil {
|
|
|
|
log.WithError(err).Fatal("Could not edit wallet configuration")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
},
|
2020-07-16 05:08:16 +00:00
|
|
|
},
|
2020-07-14 00:58:06 +00:00
|
|
|
},
|
|
|
|
}
|