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.

Patoshi パトシ
  • 4,608
  • 4
  • 27
  • 69

1 Answers1

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
user36303
  • 34,928
  • 2
  • 58
  • 123