Multichain-cli json output displaying additional header line.

0 votes

The multichain-cli output shows a header line with the method and input parameters passed. is there a way by which we suppress this output line? 

bitcoin-cli does not have this output line though.
I am trying to use a interfacing application which parses the json output. using bitcoin-cli, the appln works but because of this extra line in the beginning parser is failing.

sample output difference:

$ multichain-cli docRepo -conf=~/docRepo/multichain.conf getblockcount
{"method":"getblockcount","params":[],"id":1,"chain_name":"docRepo"}

2534
$ bitcoin-cli getblockcount
2534
$

$ multichain-cli docRepo -conf=~/docRepo/multichain.conf getaddresses
{"method":"getaddresses","params":[],"id":1,"chain_name":"docRepo"}

[
    "1RgeFTjyUzeudygDEvqTruKdKRhhaDpH2c3P4z"
]
$ bitcoin-cli getaddresses
[
  "1RgeFTjyUzeudygDEvqTruKdKRhhaDpH2c3P4z"
]
$

Difference in output is the 1st line highlighted in red.

 

 

asked Apr 19, 2016 by sanmadhavan

1 Answer

0 votes

We should add an option to remove this line. In the meantime, you can pipe the output from multichain-cli to tail to remove the unwanted lines. Something like:

multichain-cli chain1 getinfo | tail -n +3

answered Apr 19, 2016 by MultiChain
Thats a work-around I had thought :-)
I think the jsonrpc api calls also returns this extra line in the beginning, the parser needs to be modified accordingly.
The direct JSON-RPC interface should certainly not return this line, since there is no place in the JSON-RPC response format to contain it.
...