Title: get all transactions from a block [bitcoind] Post by: tspacepilot on September 04, 2014, 01:03:35 AM Hey there,
I'm playing around with rpc calls to a bitcoind instance. I can get the info about a given block by passing its hash to 'getblock': Code: $ h=`bitcoind getblockhash 150000` Do I need to parse one of these fields in order to get a list of transactions included in this block? If so, where do I find the spec for that operation? Or is there another rpc call that I should be making? Title: Re: get all transactions from a block [bitcoind] Post by: DannyHamilton on September 04, 2014, 01:20:13 AM Do I need to parse one of these fields in order to get a list of transactions included in this block? Yes. If so, where do I find the spec for that operation? Code: $ h=`bitcoind getblockhash 150000` There you go. There's your list of transactions. Or is there another rpc call that I should be making? If you want the actual details of each transaction, you'll need to call getrawtransaction and decoderawtransaction for each transaction in the list. Title: Re: get all transactions from a block [bitcoind] Post by: tspacepilot on September 04, 2014, 01:33:21 AM Thanks! I just realized this myself after posting. I think I didn't notice it because there were only 2 transactions in that random block I illustrated with.
I'm now playing with getrawtransaction. Cheers! |