Download large data from streams

+2 votes

I am trying to download data from a stream using getRawTransaction and I have verbose set to 1 so I receive my response in a JSON format.

I have tested this with a small 12 byte text file that says 'hello world', the data is in the data array in the response;

"data" : [

My next test was to upload and download a image file of size 214171 bytes. I get an error tho when I try to download this. Looking in the docker container for the getRawTransaction I see that the data string array is now an object array that contains the txid, vout and size;

            "txid" : "cd8e6a4431f31f58a2a7192a179edfc712e0941722bba8433fe29250065598a8",
            "vout" : 0,
            "size" : 285668

How and where is the actual data stored within this response so I can download the image file?

asked Nov 22, 2018 by doldy101

1 Answer

+1 vote

This is the intended behavior to prevent API responses from becoming very large. The threshold is set in the maxshowndata runtime parameter. So either increase that, or else use the gettxoutdata API to get the data in full.

answered Nov 23, 2018 by MultiChain