Retrieving published file from the stream on the second node

+1 vote
  • Now I can retrieve the file from the second node but where is the file on the second node before run txouttobinarycache? Is it not retrieved till initiating the command or is it retrieved and this command is for viewing only?
  • If the data is small and I tried to publish it off-chain why can I find it within stream as below? I expected to find it as an off-chain data also, whatever the size is to be

     "offchain" : true,
            "available" : true,
            "data" : "3438363536633663366632303734366632303666363636363230363336383631363936653230366437353663373436393633363836313639366532300a3636363936633635323030610a",

  • If the name of the file is unique, Are we still need to create item identifier? and also could we change the path of cache directory to be away from multichain directory itself ?

     

    .

 

asked Jan 15, 2020 by mina
edited Jan 15, 2020 by mina

1 Answer

+1 vote
 
Best answer

It is retrieved automatically and stored locally on the second node if that is subscribed to the stream. This command is just a method for retrieving the data from that local storage.

Offchain data is not stored within the blockchain, even if it is small. You can see small pieces but not long pieces of data within the response for various stream querying APIs, because of the maxshowndata runtime parameter. This sets a limit on how much data to show within certain API responses. If you set it to 0 than no offchain data will be shown in stream querying APIs and you will always need to use gettxoutdata or txouttobinarycache.

The name of a file in the binary cache is just a temporary local fact and has no meaning in terms of how that data is tagged on the blockchain.

You cannot change the path of the cache directory explicitly but you can replace it with a symbolic link to a directory elsewhere if you wish. Don't do this while your node is running!

answered Jan 16, 2020 by MultiChain
selected Jan 16, 2020 by mina
Being the data retrieved automatically and stored locally on the second node, what is the physical location of the file on the second node?(I mean the path of the file on the second node)
All offchain data is stored in the chunks subdirectory of your blockchain directory.
...