is it possible to publish files in multichain without encoding to hexadecimal in the new release of multichain

+2 votes
is it possible to publish files in multichain without encoding to hexadecimal in the new release of multichain

thank you
asked Jan 18, 2019 by ashir

1 Answer

0 votes

Yes, you can use the binary cache, following these steps:

  1. Use createbinarycache to create a new binary cache item.
  2. Copy the file directly to the file: ~/.multichain/[chain-name]/cache/[cache-item]
  3. Publish the item: publish [stream-name] [key-name] '{"cache":"[cache-item]"}'
  4. Use deletebinarycache to remove the binary cache item.
This is especially suitable for working with larger pieces of data.
answered Jan 20, 2019 by MultiChain
thanks, but in this case how the item is published (it encoded in hexadecimal), and why do you use deletebinarycache since the published item canot be deleted or modified
You don't need to encode it in hexadecimal for publishing – this is only how it is transmitted over API calls. And the deletebinarycache does not delete the item from the chain, it just deletes the cache that the item was published from.
but in reception what type of data the other nodes read from stream, are ther forced to do the conversion or they will receive original file
For now they have to convert the hexadecimal back in the file.
is there any possibilty to convert this hexadecimal to file, we suppose i published pdf file, in reception how can i convert the hexa and obtain this pdf file ??
thank you very much
For now you need to convert the hexadecimal to the file in your own application code. We'll soon be adding a mechanism to make this easier via the binary cache.
ok thank you
Retrieving published file from the stream on the second node
...