-
Notifications
You must be signed in to change notification settings - Fork 12
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
refactor: replace the keystore command with account cmd #54
Conversation
cmd/cmd_keystore.go
Outdated
Examples: | ||
$ gnfd-cmd keystore generate --privKeyFile key.txt `, | ||
$ gnfd-cmd account import --privKeyFile key.txt ./key.json`, |
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.
Keep to the default path? No need to specify the output keystore file.
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.
The private key file is must and is the only parameter, so no need to add this private key flag?
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.
yes, improved it.
qa-test % ./gnfd-cmd -k key.json account import key.txt3
Please enter a passphrase now:
import account successfully, key address: 0x54a22B39A51E3446b70A27F1d68753267EBa5745, encrypted key file: key.json
9ee3c92
to
aabcbb9
Compare
if err != nil { | ||
return toCmdErr(err) | ||
// key.txt contains the origin private hex string | ||
$ gnfd-cmd -k key.json account import key.txt `, |
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.
move -k key.json behind the import key.txt is better?
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.
This is a global flag, which does not belong to the account command. All other commands share this flag, so needs to put it in front.
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.
In most cases, users should not need to specify -k
* fix: remove default password file * refactor: replace keystore command with account cmd * fix: fix command description and log * feat: support account export commands and support version cmd --------- Co-authored-by: leowkong <[email protected]>
* fix: remove default password file * refactor: replace keystore command with account cmd * fix: fix command description and log * feat: support account export commands and support version cmd --------- Co-authored-by: leowkong <[email protected]>
Description
Rationale
improve usage experiment
Example
Changes
Notable changes: