Multichain Stream File Directory Location

+2 votes

Hello. I am new to Multichain and currently working on Streams. 

I had Multichain Web Demo installed on my workstation. For now, I can create, publish and view the files uploaded in the stream. My question is, where are the files actually located? Is there any location directory or the files are embedded in the chain? I just need some clarification on this.

Other than this, how can I hash my file and append the hash into my item in the stream so it will go like this?

PublishersMy First Address
Hash[Some hash value from File.docx]
Data2017-04-26 04:20:0 GMT (Confirmed)

Appreciate if anyone can give any idea. Thanks 

asked Apr 26, 2017 by frank420

1 Answer

+1 vote

The stream items are stored within the blockchain files themselves, which are in the blocks subdirectory of the blockchain directory for your chain.

If you want to include a hash with the file, you have a couple of options. Either create your own format for the stream item data, presumably starting with the hash in the first X bytes. Or write the hashes to a separate stream in the same transaction using createrawsendfrom and cross-correlate the hash and file via the same txid in both streams.

answered Apr 26, 2017 by MultiChain
Thanks for replying. So let's say one stream item is consists of a 1gb file. So the 1gb file is located to those connected to the blockchain or what?

Is there any hash function in API Commands for multichain? Thanks.
Well the limit for now is 64 MB per stream item. But yes every node would have a full copy of that item if it was embedded in a stream. If you don't want this, you should use a hash of the item instead on the chain, and deliver it separately. While MultiChain's API doesn't contain explicit hash functions, any modern programming language will have hashing libraries for you.
Hi, did you mean that 1GB files won't work with the multichain streams? Is it possible for me to change that or the limit is fixed for 64 MB?
The limit is customizable but right now you can't set it higher than 64 MB per transaction payload. Again I would recommend embedding a hash in the chain and transferring the file using other means.