How to view the metadata of a transaction when the size of the metadata is large?

+2 votes

I'm using the publish API command from my web application to write data to stream. When the metadata size becomes large, the getaddresstransaction returns only the following details in the "data" field:

"data" : [
    {
        "txid" : "6d8211b6cefc241b13e7f04b3953552b94156763d30d383e475350f973fc7dd1",
        "vout" : 0,
        "size" : 19516
    }
]

How do I view the actual data?

asked Dec 8, 2016 by Cypher

1 Answer

+1 vote
 
Best answer

There's an API gettxoutdata which does this for you. See also the maxshowndata runtime parameter which controls the threshold for when the APIs return the full data, or this reference form.

answered Dec 8, 2016 by MultiChain
selected Dec 10, 2016 by Cypher
Thank you. I noticed this api command just now. If I want to get the metadata of any transaction, should the vout parameter always be 0?
No, you should take the vout from the previous API response.
Ok got it. So it's the vout with "type"="nulldata" right?
Yes, it will have that type, but there may be more than one output that has it (if the transaction does other things). So the safe bet is to use the vout value provided.
...