axelarnetwork / tofnd

A gRPC server wrapper for the https://github.com/axelarnetwork/tofn library.
Apache License 2.0
25 stars 10 forks source link

tofnd don`t import #298

Closed yarnik1 closed 4 months ago

yarnik1 commented 2 years ago

v0.10.2

# tofnd -m import
Please type your tofnd password:

{"timestamp":"2022-05-22T08:09:15.148116Z","level":"INFO","message":"START: decrypt kvstore","spans":[{"name":"main"}]}
{"timestamp":"2022-05-22T08:09:15.350100Z","level":"INFO","message":"DONE: decrypt kvstore","spans":[{"name":"main"}]}
{"timestamp":"2022-05-22T08:09:15.350162Z","level":"INFO","message":"kv_manager cannot open existing db [/root/.tofnd/kvstore/kv]. creating new db","spans":[{"name":"main"}]}
{"timestamp":"2022-05-22T08:09:15.350197Z","level":"INFO","message":"Importing mnemonic","spans":[{"name":"main"}]}
sdaveas commented 2 years ago

hi @yarnik1 thanks for the feedback! If I understand correctly, the issue is that the tofnd binary seems to be stuck at the last step of the logs you posted. That is, because it's expecting to receive the mnemonic from the standard input at this stage.

To proceed, please paste your mnemonic and press enter -- notice that, similarly to the password prompt, the pasted mnemonic will not be shown at the terminal once pasted for security reasons.

If you want to use your mnemonic from a file (eg ~/.mnemonic) instead of pasting it at the prompt, you can adjust the import command as follows:

(echo $PASSWORD; cat ~/.mnemonic) | tofnd -m import

After the import command is successfully executed you should see something similar to the following:

{"timestamp":"2022-05-23T13:46:41.467997Z","level":"INFO","message":"START: decrypt kvstore","spans":[{"name":"main"}]}
{"timestamp":"2022-05-23T13:46:49.276357Z","level":"INFO","message":"DONE: decrypt kvstore","spans":[{"name":"main"}]}
{"timestamp":"2022-05-23T13:46:49.276429Z","level":"INFO","message":"kv_manager cannot open existing db [~/.tofnd/kvstore/kv]. creating new db","spans":[{"name":"main"}]}
{"timestamp":"2022-05-23T13:46:49.276527Z","level":"INFO","message":"Importing mnemonic","spans":[{"name":"main"}]}
{"timestamp":"2022-05-23T13:47:20.797124Z","level":"INFO","message":"Inserting mnemonic under key 'mnemonic' with total count '0'","spans":[{"name":"main"}]}
{"timestamp":"2022-05-23T13:47:20.798362Z","level":"INFO","message":"Mnemonic successfully added in kv store. Use the `-m export` command to retrieve it.","spans":[{"name":"main"}]}
{"timestamp":"2022-05-23T13:47:20.799331Z","level":"INFO","message":"Tofnd exited after using command <Import>. Run `./tofnd -m existing` to execute gRPC daemon.","spans":[{"name":"main"}]}
{"timestamp":"2022-05-23T13:47:20.799482Z","level":"INFO","message":"kv_manager stop"}

This means that your tofnd is setup with the imported mnemonic, and is ready to be started.

tofnd -m existing

Please let us know it you are facing any problems.