Atomic transaction with different operations : Am I doing it correctly ?

+2 votes

Hello everyone, 

I'm looking for a way to do different operations in one single transaction (A kind of an atomic transaction).

I would like to send an asset to someone and, afterward, issue another asset to me, all in the same transaction.

I searched about raw transaction, including the tutorial and I found something that seems to work, balances between the different keys seem ok.

My question is quite simple : Am I doing it right or should I do something else? 

Thanks a lot

Here's what I tried :

createrawsendfrom 1J2qfBtUC6F8gq1y1p57akYpvsgdhef8niBFfG ' {"1XXXXXXWrXXXXXXXmeXXXXXXTwXXXXXXWUGyo5": {"asset1":20} ,"1J2qfBtUC6F8gq1y1p57akYpvsgdhef8niBFfG": { "issue": {"raw":3000} } } ' ' [ { "name":"asset2","multiple":10,"open":true,"details":{"origin":"uk","stage":"one"} } ] ' send

asked Mar 9, 2017 by Antoine

1 Answer

+1 vote

Yes, that is exactly the right way to do it - combining mutliple examples from the raw transactions page in a single createrawsendfrom command.

answered Mar 9, 2017 by MultiChain
Any idea of the amount of operations a single raw transaction can handle? I tried to issue and make 2 publications in a stream a the same time (So three different operation) and it doesn't seems to work.
Thank you
You can't write multiple items to the same stream in a single transaction, so that's where your problem lies. Apart from that your practical limit will be the max-std-op-returns-count parameter with which you configured the blockchain.
I suppose it is also not possible to create two different assets in the same transaction ?
I get "64: Metadata script rejected - too many new entities".

(I increased max-std-op-returns-count)
Request here : https://pastebin.com/sp36iX8H

Thank you
Indeed, it is only possible to have a single issuance or reissuance event in a single transaction.
...