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?

  • 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 Apr 11 '18 at 15:20

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.