[Agri-food chain case] Add more data in a transaction.

+3 votes
I am using Multichain to make a simulation of an exchange between three actors in the food supply chain (farmer - distributor - seller).
For the exchange between farmer and distributor I use the sendwithdata command to send 10 kg of rice from the farmer to the distributor.

sendwithdata 1X9oW8LvZr5F1NUPJ6KhmT3qmUkAkq7rzqTJiW '{"Rise-Kgs": 100}' '{"for": "Farmland-Warehouse", "key": "transfer", "data": "486921"}'

My problem is this. If I wanted to add another data item in the transaction, for example, the rice harvest date, how can I do?

Thank you
asked Oct 3, 2018 by Gabriele

1 Answer

+1 vote

In this case we recommend using MultiChain 2.0 (alphas) which allow you to submit JSON data rather than just hexadecimal. For example:

sendwithdata 1X9oW8LvZr5F1NUPJ6KhmT3qmUkAkq7rzqTJiW '{"Rise-Kgs": 100}' '{"for": "Farmland-Warehouse", "key": "transfer", "data": {"json":{"a":"486921","harvest":"2018-09-30"}}}'

answered Oct 3, 2018 by MultiChain