2

I have a monero spend key and I want to generate a new wallet file using the CLI, but I want to do it in an non-interactive way so I can use this same command in my scripts. I tried doing:

monero-wallet-cli --generate-from-spend-key "xxxxxx"

But it hits me with an input for the spend key. How can I pass in the spend key from the command line and also not have a password to the wallet file. Or possibly how do I set the wallet password via the command line if I wanted to.

  • "But it hits me with an input for the spend key." <- I presume you mean it asks you for other inputs such as wallet file, password, view key (which you can also provide as additional command line parameters. – jtgrassie Dec 13 '19 at 8:07
4

You should use --generate-from-json for this. The input fields in the JSON file are:

      version: integer, should be 1
      filename: string, path/filename for the newly created wallet
      scan_from_height: 64 bit unsigned integer, optional
      password: string, optional
      viewkey: string, hex representation
      spendkey: string, hex representation
      seed: string, optional, list of words separated by spaces
| improve this answer | |
2

As an alternative to user36303's answer, you can also just supply the additional required parameters when calling with --generate-from-spend-key to prevent any prompting. E.g.

monero-wallet-cli --generate-from-spend-key "xxxxxx" \
  --wallet-file xzy --password xyz \
  --mnemonic-language English --restore-height 123456 

(and any others I may have missed)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.