Error reading JSON Data from a stream

+2 votes


I would like to store JSON data to a stream and read it again (what I have done successfully 1000 times before). Programming language is PHP (current version 7.x).

Data is from here
The data seems to be valid JSON, e.g. according to
(If I load the json with PHP function json_decode() is works, e.g. json_last_error() returns 0)

If I load the json to a stream using "publish" ($data=array('json' => $json) as always) it works, I receive a correct txid.
If I try to read it from the stream like "normal" JSON data (item['data']['json']) it does not work, because the data seems to be stored as binary data, e.g.

[data] => Array
[txid] => 67bfbb355fe8cef182c568f59dc2e90f09078209ca9631e198f22f51352f898a
[vout] => 0
[format] => json
[size] => 941282

Just to be curious: Why is that so?

Thanks for any idea, help ...


Edit: THANKS for the answer, I didn't see the obvious ...


asked Oct 7, 2020 by Chris
edited Oct 8, 2020

1 Answer

0 votes

Looks like you just need to increase the maxshowndata parameter, or if you prefer use gettxoutdata.

answered Oct 8, 2020 by MultiChain