aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-03-11 20:56:02 +0800
committerFelix Lange <fjl@twurst.com>2015-03-11 20:58:01 +0800
commit99bc44cf526b2b9692b230308f3b940e782eea7b (patch)
treea73b24c613760ba2e8e1917f6004284e8a211ac5 /cmd/utils
parent58909117bea6a8185df3335300426b8a49542235 (diff)
downloadgo-tangerine-99bc44cf526b2b9692b230308f3b940e782eea7b.tar
go-tangerine-99bc44cf526b2b9692b230308f3b940e782eea7b.tar.gz
go-tangerine-99bc44cf526b2b9692b230308f3b940e782eea7b.tar.bz2
go-tangerine-99bc44cf526b2b9692b230308f3b940e782eea7b.tar.lz
go-tangerine-99bc44cf526b2b9692b230308f3b940e782eea7b.tar.xz
go-tangerine-99bc44cf526b2b9692b230308f3b940e782eea7b.tar.zst
go-tangerine-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/utils')
-rw-r--r--cmd/utils/flags.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index e945a32ee..d8b554278 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -95,6 +95,10 @@ var (
Name: "mine",
Usage: "Enable mining",
}
+ UnencryptedKeysFlag = cli.BoolFlag{
+ Name: "unencrypted-keys",
+ Usage: "disable private key disk encryption (for testing)",
+ }
LogFileFlag = cli.StringFlag{
Name: "logfile",
@@ -220,7 +224,12 @@ func GetChain(ctx *cli.Context) (*core.ChainManager, ethutil.Database, ethutil.D
func GetAccountManager(ctx *cli.Context) *accounts.Manager {
dataDir := ctx.GlobalString(DataDirFlag.Name)
- ks := crypto.NewKeyStorePassphrase(path.Join(dataDir, "keys"))
+ var ks crypto.KeyStore2
+ if ctx.GlobalBool(UnencryptedKeysFlag.Name) {
+ ks = crypto.NewKeyStorePlain(path.Join(dataDir, "plainkeys"))
+ } else {
+ ks = crypto.NewKeyStorePassphrase(path.Join(dataDir, "keys"))
+ }
return accounts.NewManager(ks)
}