Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: valiron on September 29, 2014, 07:48:40 PM



Title: Where can I find a file with the block number and timestamp validation?
Post by: valiron on September 29, 2014, 07:48:40 PM

I know that I can get this by parsing the blockchain, but I wonder if this is available somewhere.

Thanks for your help.


Title: Re: Where can I find a file with the block number and timestamp validation?
Post by: valiron on September 30, 2014, 01:51:18 PM

Do I really need to parse the blockchain? Nothing available somewhere?


Title: Re: Where can I find a file with the block number and timestamp validation?
Post by: hhanh00 on September 30, 2014, 03:15:35 PM
You don't need to parse the blockchain. You can use the RPC JSON API to bitcoin core, electrum, blockchain.info, etc.
"getblock"



Title: Re: Where can I find a file with the block number and timestamp validation?
Post by: valiron on September 30, 2014, 11:27:36 PM
You don't need to parse the blockchain. You can use the RPC JSON API to bitcoin core, electrum, blockchain.info, etc.
"getblock"



Thank you for your help. Where can I find more about RPC JSON API in order to get a csv file for example?


Title: Re: Where can I find a file with the block number and timestamp validation?
Post by: deepceleron on October 01, 2014, 02:17:13 AM
Here's a PM I wrote someone else with the details of wot to do.

Quote from: deepceleron
I have a CSV of block times: https://bitcointalk.org/index.php?topic=135982.msg1453722#msg1453722

I dumped them on Windows with this "dumptime.cmd" in the bitcoind directory (and then added some more spreadsheet columns to make epoch time readable time), here it dumps times from block 50000-99999:

Code:
@echo off 
setlocal enableextensions
set /a height=50000
rem echo --start > timeout.txt
:beg
for /f "tokens=* delims=:" %%a in (
'bitcoind getblockhash %height%'
) do (
set hash=%%a
)

for /f "tokens=*" %%a in (
'bitcoind getblock %hash% ^| find "time"'
) do (
set blktim=%%a
)
echo %height%: %blktim%
echo %height%: %blktim% >> timeout.txt

set /a height = height + 1
IF %height% LEQ 99999 goto beg

endlocal 



Code:
blocknum,epochtime,blocksec,datetime
0,1231006505,0,2009-01-03T18:15:05Z
1,1231469665,0,2009-01-09T02:54:25Z
2,1231469744,79,2009-01-09T02:55:44Z
3,1231470173,429,2009-01-09T03:02:53Z
4,1231470988,815,2009-01-09T03:16:28Z
5,1231471428,440,2009-01-09T03:23:48Z
6,1231471789,361,2009-01-09T03:29:49Z
7,1231472369,580,2009-01-09T03:39:29Z
8,1231472743,374,2009-01-09T03:45:43Z
9,1231473279,536,2009-01-09T03:54:39Z
10,1231473952,673,2009-01-09T04:05:52Z
11,1231474360,408,2009-01-09T04:12:40Z
12,1231474888,528,2009-01-09T04:21:28Z
13,1231475020,132,2009-01-09T04:23:40Z
14,1231475589,569,2009-01-09T04:33:09Z


Title: Re: Where can I find a file with the block number and timestamp validation?
Post by: valiron on October 01, 2014, 02:47:21 PM

Great! Thanks for your help. It will save me some time.