diff options
author | Felix Lange <fjl@twurst.com> | 2015-03-11 20:56:02 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-03-11 20:58:01 +0800 |
commit | 99bc44cf526b2b9692b230308f3b940e782eea7b (patch) | |
tree | a73b24c613760ba2e8e1917f6004284e8a211ac5 /cmd/ethereum/main.go | |
parent | 58909117bea6a8185df3335300426b8a49542235 (diff) | |
download | dexon-99bc44cf526b2b9692b230308f3b940e782eea7b.tar dexon-99bc44cf526b2b9692b230308f3b940e782eea7b.tar.gz dexon-99bc44cf526b2b9692b230308f3b940e782eea7b.tar.bz2 dexon-99bc44cf526b2b9692b230308f3b940e782eea7b.tar.lz dexon-99bc44cf526b2b9692b230308f3b940e782eea7b.tar.xz dexon-99bc44cf526b2b9692b230308f3b940e782eea7b.tar.zst dexon-99bc44cf526b2b9692b230308f3b940e782eea7b.zip |
cmd/ethereum: add a flag to switch to unencrytped keystore
This is mostly for automated tests. The tests can use the following
commands to start the node:
ethereum --unencrypted-keys account new
...
ethereum --unencrypted-keys
Diffstat (limited to 'cmd/ethereum/main.go')
-rw-r--r-- | cmd/ethereum/main.go | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 7b912cf6e..89e19e47f 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -127,6 +127,7 @@ runtime will execute the file and exit. utils.RPCEnabledFlag, utils.RPCListenAddrFlag, utils.RPCPortFlag, + utils.UnencryptedKeysFlag, utils.VMDebugFlag, //utils.VMTypeFlag, } @@ -213,20 +214,24 @@ func accountList(ctx *cli.Context) { func accountCreate(ctx *cli.Context) { am := utils.GetAccountManager(ctx) - fmt.Println("The new account will be encrypted with a passphrase.") - fmt.Println("Please enter a passphrase now.") - auth, err := readPassword("Passphrase: ", true) - if err != nil { - utils.Fatalf("%v", err) - } - confirm, err := readPassword("Repeat Passphrase: ", false) - if err != nil { - utils.Fatalf("%v", err) - } - if auth != confirm { - utils.Fatalf("Passphrases did not match.") + passphrase := "" + if !ctx.GlobalBool(utils.UnencryptedKeysFlag.Name) { + fmt.Println("The new account will be encrypted with a passphrase.") + fmt.Println("Please enter a passphrase now.") + auth, err := readPassword("Passphrase: ", true) + if err != nil { + utils.Fatalf("%v", err) + } + confirm, err := readPassword("Repeat Passphrase: ", false) + if err != nil { + utils.Fatalf("%v", err) + } + if auth != confirm { + utils.Fatalf("Passphrases did not match.") + } + passphrase = auth } - acct, err := am.NewAccount(auth) + acct, err := am.NewAccount(passphrase) if err != nil { utils.Fatalf("Could not create the account: %v", err) } |