Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: fevir on August 25, 2015, 07:29:23 PM



Title: Getting nonces
Post by: fevir on August 25, 2015, 07:29:23 PM
Hi all,

Each block in the blockchain contains a nonce - a seemingly insignificant, yet important number for each block.

Assuming I'm running a full node and have a copy of the blockchain, what would be a (preferably easy) way to get a list (just plain text will do) of all nonces from the Genesis block up untill now?

Thanks!

Cheers,
Fevir


Title: Re: Getting nonces
Post by: achow101 on August 25, 2015, 07:33:29 PM
You can create a script which goes through each block and uses the getblockhash and getblock rpc commands. You can retrieve the json data for each block which includes a field for the nonce. Then just extract the nonce and save that to a file.


Title: Re: Getting nonces
Post by: fevir on August 25, 2015, 07:42:17 PM
Thanks! I'll see if I can create such a script.