error when publishing large files to a stream

+2 votes
HI,

I am trying to write a pdf file, the size is 18MB and I get this error, I am using the multichain-node sdk

{ Error: read ECONNRESET
    at _errnoException (util.js:992:11)
    at TCP.onread (net.js:618:25) code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' }

Any idea why?

Thanks!
asked Oct 16, 2018 by anonymous

1 Answer

+1 vote

This will be a problem caused by the JSON-RPC connection (which itself runs over HTTP) failing before the file has finished being transferred. You can check the Node system for a timeout that could be causing this.

Alternatively, use MultiChain 2.0 (alphas) which allows large pieces of data to be delivered to MultiChain via the file system, using the binary cache. Search the page below for createbinarycache, appendbinarycache, deletebinarycache and "cache" (with the quotes) to learn more:

https://www.multichain.com/developers/multichain-2-0-preview-releases/

answered Oct 17, 2018 by MultiChain
Thanks. I am already using multichain 2 alpha4 though
So you should use the binary cache. Create an item with createbinarycache, then access it directly via the file system, then use the "cache":"...." syntax to write it to the blockchain. If you tell me more specifically how you're trying to write the large item I can send exact instructions.
...