0

I need to create an encrypted blank wallet, and for this purpose I need to furnish bitcoin-cli --testnet createwallet testwallet with two more optional arguments. Let the passphrase be "k3YQN3JOtyHMlRCg4v4". How do I do this?

I came across this example from bitcoin-cli help createwallet:

curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createwallet", "params": ["testwallet"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/

Whereas I've used curl before for scraping I would rather avoid using just creating a wallet?

I have already figured out a way of how to do this using -named:

/home/jerzy/bitcoin/bin/bitcoin-cli --testnet -named createwallet wallet_name=testwtwo blank=true passphrase=k3YQN3JOtyHMlRCg4v4

Now, I would like to do the same by passing the optional argumets in JSON. I've tried all the following but to no avail:

/home/jerzy/bitcoin/bin/bitcoin-cli --testnet createwallet testwtwo '{ "blank":"true", "passphrase":"k3YQN3JOtyHMlRCg4v4" }'
error code: -1
error message:
JSON value is not a boolean as expected

/home/jerzy/bitcoin/bin/bitcoin-cli --testnet createwallet testwtwo '{ "blank":true, "passphrase":"k3YQN3JOtyHMlRCg4v4" }'
error code: -1
error message:
JSON value is not a boolean as expected

/home/jerzy/bitcoin/bin/bitcoin-cli --testnet createwallet testwtwo '{ blank : true, passphrase : "k3YQN3JOtyHMlRCg4v4" }'
error: Error parsing JSON: { blank : true, passphrase : "k3YQN3JOtyHMlRCg4v4" }

How do I do this?

1

bitcoin-cli --testnet -named createwallet wallet_name=testwtwo blank=true passphrase=k3YQN3JOtyHMlRCg4v4

Doing same thing without using -named

bitcoin-cli -testnet createwallet testwtwo false true k3YQN3JOtyHMlRCg4v4

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.