autonity / aut

A command-line RPC client for Autonity
MIT License
11 stars 10 forks source link

New account created cause `ValueError: non-hexadecimal number found in fromhex() arg at position 0` when imported by `import-private-key` #98

Closed chrisckwong821 closed 1 year ago

chrisckwong821 commented 1 year ago

To reproduce; aut account new Then: aut account import-private-key ./.autonity/keystore/XXX.key -> ValueError: non-hexadecimal number found in fromhex() arg at position 0

aut, version 0.1.2 Mac OS Monterey

dtebbs commented 1 year ago

Thanks @chrisckwong821 . I think you are attempting to import an encrypted key, rather than a raw private key. The keystore files used by autonity can be used as-is, so there is no need to import. You should be able to just refer to the files and use them.

Just to clarify aut account new will create a new encrypted keyfile. aut account import-private-key will take a raw private key, and also create a new encrypted keyfile.

dtebbs commented 1 year ago

I'll close for now, but feel free to reopen if you hit more problems.

dtebbs commented 1 year ago

(BTW, feel free to propose a change to the docs if anything is unclear).