Can i send multiple transaction for 1 key at a time

+2 votes
Can i send multiple transaction for 1 key at a time. If suppose i want to add multiple transaction for 1 key at a time instead of multiple entry.

publish stream1 "[\"A000001\"]" "{\"json\":{\"STATUS\":\"APPROVED\",\"RECEIVED DATE\":\"2019-05-16 15:20\",\"USERNAME\":\"APP1\"}}"
publish stream1"[\"A000001\"]" "{\"json\":{\"STATUS\":\"HOLD\",\"RECEIVED DATE\":\"2019-05-16 16:20\",\"USERNAME\":\"APP1\"}}"
asked May 20, 2019 by Sunita More

1 Answer

+1 vote

If you are using MultiChain 2.0, use "publishmulti"

For example: publishmulti <stream-name> '[{"key":"A000001","data":"48656C6C6F20576F726C64210A"},{"key":"A000001","data":"00"}]'

or

You can execute an equivalent of multiple publish commands by using createrawsendfrom.

For example:

createrawsendfrom '<address>' , {}, '[{"for" : "stream-name", "key" : "A000001", "data" : "whatever-data"},{"for" : "stream-name", "key" : "A000001", "data" : "other-data"}]', 'send'

PS: This syntax is for linux.

For help with API commands visit: https://www.multichain.com/developers/json-rpc-api/

answered May 20, 2019 by mirabdulHaseeb
edited May 20, 2019 by mirabdulHaseeb
Hi Thanks for the reply.

Can you please provide syntax for Windows and What will be address? Is it Chain Name?

Please give me full syntax.

Thanks.
This will store data in Hexadecimal format only.
To store text use {"text":"..."} like so :
 createrawsendfrom '<address>' , {}, '[{"for" : "stream-name", "key" : "A000001", "data" : {"text":"..."}},{"for" : "stream-name", "key" : "A000001", "data" : {"text":"..."}}]', 'send'
The "address" here refers to the node's address from which you want to publish data from.You can find the address of your node by typing "listpermissions" (listpermissions admin if you want to know the node's address with admin privileges) command in the CLI.

For windows syntax please refer to this page for help. It contains all the information you need: https://www.multichain.com/getting-started/

I hope this helps.
...