Closed rmsams closed 1 year ago
Added to v0.0.6
Now available in develop:
$ pipx install --force git+ssh://git@github.com/autonity/autcli.git@develop
(note the change from --key-file
to --keyfile
for consistency)
Let me know if there is further feedback.
The two
aut account
commands for creating a new keyfile from an existing private key (import-private-key
) or a newly generated private key (new
) both currently mandate that user defines the keyfile name with the--key-file
option. To me, this seems like it should be a non-default, special case where user for some reason wants to specify the keyfile filename. The default case should be like it is withclef newaccount
, where user only specifies the keystore directory (optionally, ifkeystore
is defined in user's.autrc
config) and the keyfile name is autogenerated using a timestamp and the ethereum account (all lowercase, not checksum) of the key saved in the file, e.g.,This is a safer practice, always having the account in the filename. When user comes to use one of these keyfiles, custom names introduce an abstraction that can easily lead to error unless user cat's the keyfile to confirm that her assumption about the account being used is correct.
It's also better to keep the keyfile creation practice consistent with geth, as user may be using both
clef
andautcli
. Consistency across tools writing to the same directory should be the default unless there's a good reason to deviate.Finally, this avoids user having to deal with one of the hardest problems in computer science! ;)
Proposal: in both of these commands, add an option
--keystore
which accepts a path to user's keystore. When this option is used, keyfile filename is autogenerated per above convention. When--key-file
is used, behaviour is as currently implemented (if--keystore
is also present, it's ignored and command echo's a warning message saying so). If neither option is used, assume the first case and search.autrc
for the keystore value and throw an error if not found.