So is it possible to write into different streams in one transaction?

+1 vote
In some business cases, we need to write data into different database tables in the same transaction. how to realize the same in multichain? i.e. all records should be committed together or not.
asked Jul 12, 2018 by Daniel

1 Answer

+1 vote
Best answer

Yes, it's absolutely possible. You should use the createrawsendfrom API and pass multiple items in the third parameter. See the 'Publishing to streams' section on this page:

answered Jul 12, 2018 by MultiChain
Thanks for the answer. I am using Multichain 2.0, will this version provide new API or enhance the existing publish API to support multi stream writing? Or should I still follow the suggestion above to use createrawsendfrom API?
You should still use createrawsendfrom, it's a pretty easy API to use. If you pass "send" in the final parameter it takes care of signing and broadcasting the transaction for you.