2020-07-14 00:58:06 +00:00
package v2
import (
2020-07-24 00:43:01 +00:00
"github.com/prysmaticlabs/prysm/shared/featureconfig"
2020-07-14 00:58:06 +00:00
"github.com/prysmaticlabs/prysm/validator/flags"
"github.com/urfave/cli/v2"
)
// AccountCommands for accounts-v2 for Prysm validators.
2020-07-15 04:05:21 +00:00
var AccountCommands = & cli . Command {
Name : "accounts-v2" ,
Category : "accounts" ,
Usage : "defines commands for interacting with eth2 validator accounts (work in progress)" ,
Subcommands : [ ] * cli . Command {
// AccountCommands for accounts-v2 for Prysm validators.
{
2020-07-24 02:18:36 +00:00
Name : "create" ,
2020-07-28 19:23:53 +00:00
Description : ` creates a new validator account for eth2 . If no wallet exists at the given wallet path , creates a new wallet for a user based on
2020-07-14 00:58:06 +00:00
specified input , capable of creating a direct , derived , or remote wallet .
this command outputs a deposit data string which is required to become a validator in eth2 . ` ,
2020-07-15 04:05:21 +00:00
Flags : [ ] cli . Flag {
flags . WalletDirFlag ,
flags . WalletPasswordsDirFlag ,
flags . PasswordFileFlag ,
2020-07-27 14:03:30 +00:00
flags . NumAccountsFlag ,
2020-07-24 00:43:01 +00:00
featureconfig . AltonaTestnet ,
featureconfig . MedallaTestnet ,
2020-07-15 04:05:21 +00:00
} ,
2020-07-22 02:04:08 +00:00
Action : func ( cliCtx * cli . Context ) error {
2020-07-24 02:18:36 +00:00
if err := CreateAccount ( cliCtx ) ; err != nil {
2020-07-23 00:11:00 +00:00
log . Fatalf ( "Could not create new account: %v" , err )
2020-07-22 02:04:08 +00:00
}
return nil
} ,
2020-07-14 00:58:06 +00:00
} ,
2020-07-15 04:05:21 +00:00
{
Name : "list" ,
Description : "Lists all validator accounts in a user's wallet directory" ,
Flags : [ ] cli . Flag {
flags . WalletDirFlag ,
flags . WalletPasswordsDirFlag ,
2020-07-23 03:10:23 +00:00
flags . PasswordFileFlag ,
2020-07-15 04:05:21 +00:00
flags . ShowDepositDataFlag ,
2020-07-24 00:43:01 +00:00
featureconfig . AltonaTestnet ,
featureconfig . MedallaTestnet ,
2020-07-15 04:05:21 +00:00
} ,
2020-07-22 02:04:08 +00:00
Action : func ( cliCtx * cli . Context ) error {
if err := ListAccounts ( cliCtx ) ; err != nil {
2020-07-23 00:11:00 +00:00
log . Fatalf ( "Could not list accounts: %v" , err )
2020-07-22 02:04:08 +00:00
}
return nil
} ,
2020-07-14 00:58:06 +00:00
} ,
2020-07-15 04:05:21 +00:00
{
Name : "export" ,
Description : ` exports the account of a given directory into a zip of the provided output path. This zip can be used to later import the account to another directory ` ,
Flags : [ ] cli . Flag {
flags . WalletDirFlag ,
flags . WalletPasswordsDirFlag ,
2020-07-23 03:10:23 +00:00
flags . BackupDirFlag ,
2020-07-15 23:00:00 +00:00
flags . AccountsFlag ,
2020-07-24 00:43:01 +00:00
featureconfig . AltonaTestnet ,
featureconfig . MedallaTestnet ,
2020-07-15 04:05:21 +00:00
} ,
2020-07-22 02:04:08 +00:00
Action : func ( cliCtx * cli . Context ) error {
if err := ExportAccount ( cliCtx ) ; err != nil {
2020-07-23 00:11:00 +00:00
log . Fatalf ( "Could not export accounts: %v" , err )
2020-07-22 02:04:08 +00:00
}
return nil
} ,
2020-07-14 00:58:06 +00:00
} ,
2020-07-15 04:05:21 +00:00
{
Name : "import" ,
Description : ` imports the accounts from a given zip file to the provided wallet path. This zip can be created using the export command ` ,
Flags : [ ] cli . Flag {
flags . WalletDirFlag ,
flags . WalletPasswordsDirFlag ,
2020-07-28 14:18:22 +00:00
flags . KeysDirFlag ,
2020-07-15 23:00:00 +00:00
flags . PasswordFileFlag ,
2020-07-24 00:43:01 +00:00
featureconfig . AltonaTestnet ,
featureconfig . MedallaTestnet ,
2020-07-15 04:05:21 +00:00
} ,
2020-07-22 02:04:08 +00:00
Action : func ( cliCtx * cli . Context ) error {
if err := ImportAccount ( cliCtx ) ; err != nil {
2020-07-23 00:11:00 +00:00
log . Fatalf ( "Could not import accounts: %v" , err )
2020-07-22 02:04:08 +00:00
}
return nil
} ,
2020-07-14 00:58:06 +00:00
} ,
} ,
}