'getrawtransaction' for counterparty

Hey guys,


I just wanted to drop this in here as a note, I spent the last day or so going over the counterpartyd code and couldn’t find a way to directly inspect low level data coming off the blockchain (I’m aware of querying the SQL tables, but that wasn’t ideal for my workflow) so I wrote a tool to do that.

Right now what it does is query your local bitcoind node (I’m sure this can be hooked up into blockr or something if someone wants me to do that) on some txid, decodes and parses the data according to the counterpartyd reference implementation, and spits the data fields right out.

This can be pretty useful for debugging why some transaction failed or became invalid, and I hope to keep improving it as I continue exploring this space! 

Link to code: https://github.com/faizkhan00/msc-scripts-n-tricks/tree/master/counterparty

Example output:

python2 counterparty_decoder.py  13s8t8Dp7aqqxrEu1mAcaHAnyT9y7GkeAp f02c51bc6b2b2ab9990a6bd7da7e9164c8fe182987118a400aa3bce265f02437

Encoded packet Found : 20434e5452505254590000001e543e89d2bff00000000000000007a12014626574
Encoded packet Found : 117863702e636f6d2f666565642f32363837000000000000000000000000000000

Message type: 30
Broadcast:
Timestamp: 1413384658
Value: -1.0
Fee fraction: 500000
Text: betxcp.com/feed/2687`

<pre style="box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; margin-top: 0px; margin-bottom: 16px; line-height: 1.45; padding: 16px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; color: rgb(51, 51, 51); background-color: rgb(247, 247, 247);"><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; line-height: inherit; padding: 0px; margin: 0px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; border: 0px; display: inline; word-wrap: normal; background: transparent;">Feedback welcome! `

That’s cool. You’re effort and interest is greatly appreciated. Keep up the good work.

With your skills… I don’t suppose you could have a look in this thread and let me know what you think - https://forums.counterparty.io/discussion/418/the-crossparty-protocol#latest.