is it possible to retrieve some block transactions using bitcoin-core?

0

I'm trying to fetch specific block transactions, is it possible to do so using bitcoin-core?

for example block number: 517716 can I get hex transactions or even just the txid's of that block?

Adam

Posted 2018-04-11T14:51:39.427

Reputation: 3 215

I don't understand the question. Are you saying you want to retrieve all the transactions that were mined in a specific block? In what format?Nate Eldredge 2018-04-11T15:20:20.077

Answers

2

Yes. Use the getblockhash and getblock commands. You would do:

getblockhash 517716

and this will return you the block hash for block 517716. Then you can do

getblock <hash> 2

where <hash> is the hash from getblockhash. This will give you the full block details with the full details of all of the transactions in the block. If you just want txids, change the 2 to a 1.


Note that this only works if you are not in pruned mode. If you are pruning, there is no guarantee that you still have the block.

Andrew Chow

Posted 2018-04-11T14:51:39.427

Reputation: 40 910