-
Notifications
You must be signed in to change notification settings - Fork 20.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/utils: implement configurable developer (--dev) account options #21301
cmd/utils: implement configurable developer (--dev) account options #21301
Conversation
Prior to this change --dev (developer) mode generated one account with an empty password, irrespective of existing --password and --miner.etherbase options. This change makes --dev mode compatible with these existing flags. --dev mode may now be used in conjunction with --password and --miner.etherbase flags to configure the developer faucet using an existing keystore or in creating a new account. Signed-off-by: meows <b5c6@protonmail.com>
I don't know if we should make This PR makes it possible for someone to point the devmode to use/interact with the actual mainnet keystore. |
Dev mode already can interact with the actual mainnet keystore as well as any other keystore. > mv ~/.ethereum/keystore{,.bak}
> mkdir ~/.ethereum/keystore
> ./build/bin/geth --dev --keystore=~/.ethereum/keystore --exec 'exit;' console > /dev/null 2>&1
> ls -lshat ~/.ethereum/keystore
-rw------- 1 ia ia 491 Jul 7 20:05 UTC--2020-07-08T01-05-08.752300796Z--236cfc1e5ebab5d73a7ff819ca4880d2d16043ab
> ./build/bin/geth version
Geth
Version: 1.9.16-unstable
Git Commit: e5871b928fb0a4caf65153b552187c5c103e24d7
Architecture: amd64
Protocol Versions: [65 64 63]
Go Version: go1.14.3
Operating System: linux
GOPATH=/home/ia/go
GOROOT=/home/ia/go1.14.3.linux-amd64
This PR doesn't modify the behavior of Since the default value for the dev mode keystore is a temporary I for one have found this feature useful for development. Having the ability to use a static key (or set of keys) just decrements the number of variables you may need to manage. |
I'll pick this up. While I agree that dev mode shouldn't be made smart, we already support persistency, this just supports custom password or pointing a dev chain to an existing account. I can imagine that might be useful in some integration test with hard coded accs, so ok by me. The code is also super tiny and localized, so +1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flags need to be deduplicated.
These flags are included already in other sections, and it is not desired to duplicate them. They were originally included in this section along with added support for these flags in the developer mode. Signed-off-by: meows <b5c6@protonmail.com>
Thanks for the PR! |
I have a question in version 1.9.25 where can I find the generated passphrase in dev mode? |
With those commands, the passphrase should be empty (
|
…thereum#21301) * geth,utils: implement configurable developer account options Prior to this change --dev (developer) mode generated one account with an empty password, irrespective of existing --password and --miner.etherbase options. This change makes --dev mode compatible with these existing flags. --dev mode may now be used in conjunction with --password and --miner.etherbase flags to configure the developer faucet using an existing keystore or in creating a new account. Signed-off-by: meows <b5c6@protonmail.com> * main: remove key/pass flags from usage developer section These flags are included already in other sections, and it is not desired to duplicate them. They were originally included in this section along with added support for these flags in the developer mode. Signed-off-by: meows <b5c6@protonmail.com>
Prior to this change --dev (developer) mode
generated one account with an empty password,
irrespective of existing --password and --miner.etherbase
options.
This change makes --dev mode compatible with these
existing flags.
--dev mode may now be used in conjunction with
--password and --miner.etherbase flags to configure
the developer faucet using an existing keystore or
in creating a new account.