Atomic transactions on single node

+1 vote
I have a simple setup like a single node having multiple addresses. I want to send say 100 units from address1 to address2 in one transaction and another 5 units from same address1 to address2 in another transaction. I want both these transactions to be atomic. Is it possible to club the above one way transactions together? The examples I have seen are about exchange.
asked Apr 10, 2018 by anonymous

1 Answer

0 votes
Yes, it's absolutely possible – you just execute all the same steps as a regular atomic exchange transaction, but using a single node only: https://www.multichain.com/developers/atomic-exchange-transactions/
answered Apr 10, 2018 by MultiChain
Found this command in documentation which meets my requirement:

createrawsendfrom 1... '{"1...":{"asset3":20,"asset4":30},"1...":{"asset3":30,"asset4":20}}' '["5554584f732046545721"]' send

Is there a way to execute this using single json-rpc call? I have to call createrawsendfrom, signrawtransaction and sendrawtransaction in sequence to successfully get the result. The cli uses single command shown above)
First I'm not sure createrawsendfrom will do what you want, since it can only send assets from a single address, and you want to send from two different addresses.

In any event, you can certainly execute that createrawsendfrom (or any other command) in a single JSON-RPC API call. The multichain-cli tool is just a wrapper for the JSON-RPC interface, nothing more.
...