Store and retrieve huge binary files in off-chain

+2 votes

In Multichain 2.0, when you use the binary cache, you can directly append large binary files and then publish them off-chain from the cache.

However, when you want to retrieve them back, you get a huge HEX string which simply cannot be handled in memory, so how do you convert back to the original binary file?

asked Jan 21 by emedina

1 Answer

+1 vote
Best answer

The gettxoutdata command has optional parameters that allow you to retrieve part of the data only, by providing byte offsets and counts. This lets you retrieve the item's data e.g. 1 MB at a time.

answered Jan 21 by MultiChain
selected Jan 22 by emedina