appendrawdata is not working

+1 vote

Hi Team,

I am using the example of "Issuing Asset" from this link https://www.multichain.com/developers/raw-transactions/

I have succesfully executed -

createrawtransaction '[{"txid":"dd2a022d2e3f7cc2f3a083fce2a4009a18b54405dc86a58f1a08c40efc3d0a30","vout":1}]' '{"1A6RobCuj7LgRktha9yTxLTWYkUdpetgGz5iVv":{"issue":{"raw":2000}},"1UdP6xqz3SuK5MfeT1DPaPG2iwZwP5Dvzq2UMG":{"issue":{"raw":3000}}}'

{"method":"createrawtransaction","params":[[{"txid":"dd2a022d2e3f7cc2f3a083fce2a4009a18b54405dc86a58f1a08c40efc3d0a30","vout":1}],{"1A6RobCuj7LgRktha9yTxLTWYkUdpetgGz5iVv":{"issue":{"raw":2000}},"1UdP6xqz3SuK5MfeT1DPaPG2iwZwP5Dvzq2UMG":{"issue":{"raw":3000}}}],"id":1,"chain_name":"streamchain"}

0100000001300a3dfc0ec4081a8fa586dc0544b5189a00a4e2fc83a0f3c27c3f2e2d022add0100000000ffffffff0200000000000000002776a91443486094e992d123e2102f8f956b1137a2c5e1cf88ac0c73706b67d0070000000000007500000000000000002776a914cc697bdd8617017860ecfe7aa888d13413cfd1ae88ac0c73706b67b80b0000000000007500000000

But while doing AppenrawData I am getting below error -

 appendrawdata 0100000001300a3dfc0ec4081a8fa586dc0544b5189a00a4e2fc83a0f3c27c3f2e2d022add0100000000ffffffff0200000000000000002776a91443486094e992d123e2102f8f956b1137a2c5e1cf88ac0c73706b67d0070000000000007500000000000000002776a914cc697bdd8617017860ecfe7aa888d13413cfd1ae88ac0c73706b67b80b0000000000007500000000 '{"name":"asset7","multiple":10,"open":true,"details":{"origin":"uk","stage":"one"}}'
{"method":"appendrawdata","params":["0100000001300a3dfc0ec4081a8fa586dc0544b5189a00a4e2fc83a0f3c27c3f2e2d022add0100000000ffffffff0200000000000000002776a91443486094e992d123e2102f8f956b1137a2c5e1cf88ac0c73706b67d0070000000000007500000000000000002776a914cc697bdd8617017860ecfe7aa888d13413cfd1ae88ac0c73706b67b80b0000000000007500000000",{"name":"asset7","multiple":10,"open":true,"details":{"origin":"uk","stage":"one"}}],"id":1,"chain_name":"streamchain"}

error code: -8
error message:

Unrecognized parameter format

 

Please help me out.

asked Aug 19, 2018 by adgupta
Which version of MultiChain are you using?
Multichain 2.0 alpha 3

1 Answer

+1 vote

If you're using MultiChain 2.0 (alpha), you need to specify the issuance in this form:

'{"create":"asset","name":"asset8","multiple":10,"open":true,"details":{"origin":"uk","stage":"one"}}'

Basically, the "create":"asset" element is required in the data object as well.

Note also that the appendrawdata API takes a single data object as a parameter, not an array.

answered Aug 19, 2018 by MultiChain
edited Aug 21, 2018 by MultiChain
Its still not working.
streamchain: createrawtransaction '[{"txid":"7d0d6f85b169cd39b74e7cbc8b524d3ff5aa2a3d9a9df0c251ecaea888b2f100","vout":1}]' '{"1A6RobCuj7LgRktha9yTxLTWYkUdpetgGz5iVv":{"issue":{"raw":2000}}}'
{"method":"createrawtransaction","params":[[{"txid":"7d0d6f85b169cd39b74e7cbc8b524d3ff5aa2a3d9a9df0c251ecaea888b2f100","vout":1}],{"1A6RobCuj7LgRktha9yTxLTWYkUdpetgGz5iVv":{"issue":{"raw":2000}}}],"id":1,"chain_name":"streamchain"}

010000000100f1b288a8aeec51c2f09d9a3d2aaaf53f4d528bbc7c4eb739cd69b1856f0d7d0100000000ffffffff0100000000000000002776a91443486094e992d123e2102f8f956b1137a2c5e1cf88ac0c73706b67d0070000000000007500000000

streamchain: appendrawdata 010000000100f1b288a8aeec51c2f09d9a3d2aaaf53f4d528bbc7c4eb739cd69b1856f0d7d0100000000ffffffff0100000000000000002776a91443486094e992d123e2102f8f956b1137a2c5e1cf88ac0c73706b67d0070000000000007500000000 '[{"create":"asset","name":"asset8","multiple":10,"open":true,"details":{"origin":"uk","stage":"one"}}]'
{"method":"appendrawdata","params":["010000000100f1b288a8aeec51c2f09d9a3d2aaaf53f4d528bbc7c4eb739cd69b1856f0d7d0100000000ffffffff0100000000000000002776a91443486094e992d123e2102f8f956b1137a2c5e1cf88ac0c73706b67d0070000000000007500000000",[{"create":"asset","name":"asset8","multiple":10,"open":true,"details":{"origin":"uk","stage":"one"}}]],"id":1,"chain_name":"streamchain"}

error code: -8
error message:
Invalid parameter type, should be object or string
Apologies - you also need to remove the square brackets [] around the parameter because appendrawdata appends a single data item. The answer has now been corrected.
...