Passing a JSON argument to bitcoind in Windows command prompt

9

I've been trying to use sendmany on my local installation of Bitcoin-qt (version 0.7.0) from the Windows command prompt. I've seen examples but when I try them all I get is a JSON parsing error. I figure that on Windows the input needs to be escaped in a different way than on Linux.

How do I pass a JSON argument to bitcoind from the Windows command prompt?

Meni Rosenfeld

Posted 2012-11-20T18:32:02.890

Reputation: 18 542

1Any chance we could get an example of what you're trying to pass and how you've currently attempted to escape it?David Perry 2012-11-20T21:38:47.183

1

Unbelievable. I had already seen https://bitcointalk.org/index.php?topic=54879.0 and unsuccessfully tried to replicate it; it turns out I made an error in visually reproducing it. The question is still valid though and I'll take the liberty of answering it.

Meni Rosenfeld 2012-11-21T05:54:41.163

Sadly, my sendmany woes are not over yet, though that is irrelevant to this question.Meni Rosenfeld 2012-11-21T05:57:22.120

Answers

5

The important part is that strings should be enclosed in triple double-quotation marks. For example:

bitcoind sendmany "" {"""1ELvnrA6PhUyDBS6iR25K1Xx4xXL6VMfJX""":0.001,"""1NX3R5Le4c1y9E316NPMze7aEmCXjpCY58""":0.001}

Meni Rosenfeld

Posted 2012-11-20T18:32:02.890

Reputation: 18 542

Hello, I googled this answer, is the triple quotation a windows thing or is it needed in bash, too?Karel Bílek 2014-02-17T17:48:21.540

@KarelBílek: I don't remember. Let us know what you find.Meni Rosenfeld 2014-02-17T19:52:09.260