Here’s a large transaction:
https://blockchain.info/tx/9873d0244d71b3358a04675e033d3405e48bfcfe7b65166c34f2942b1ca0e41f
It’s around 67 kB.
Running this:
0$ bitcoind getrawtransaction 9873d0244d71b3358a04675e033d3405e48bfcfe7b65166c34f2942b1ca0e41f
gives me 133,920 hex digits of raw transaction. If I try to decoderawtransaction
I’m told:
0bash: bitcoind: Argument list too long
It appears (http://www.linuxjournal.com/article/6060?page=0,1) that the Linux kernel limits command lines to 128kB by default, and that’s the limit I’m running up against here.
It would be useful if there was some way of decoding a transaction giving just the transaction ID, so I don’t have to copy the huge hex string output and feed it back in as input.
Maybe decodetransaction
would be a good name for it, and it would basically just getrawtransaction
and then decoderawtransaction
.
All I really need is the scriptPubKey
of a particular output of the transaction, and so would be happy with an RPC call that just grabs that, taking a txid and vout as arguments, but that’s probably overly specific.
Alternatively, if bitcoin-cli had an option to read its parameters from stdin, that would work too, and allow arbitrarily large amounts of input.