Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: remotemass on September 13, 2013, 03:12:14 PM



Title: Latest block hash
Post by: remotemass on September 13, 2013, 03:12:14 PM
Is there any better than blockexplorer to keep up to date with the latest block hash. I find blockexplorer to lag a lot in having updated data.


Title: Re: Latest block hash
Post by: CIYAM on September 13, 2013, 03:14:10 PM
You don't use blockchain.info for that?


Title: Re: Latest block hash
Post by: remotemass on September 13, 2013, 03:18:29 PM
The same, the latest block there seems to be from one hour ago, not from ten minutes ago...
Wait, maybe it is because only after 6 confirmations it gets likely for it to persist in the blockchain. Is that it?


Title: Re: Latest block hash
Post by: CIYAM on September 13, 2013, 03:22:51 PM
New blocks are found *on average* every 10 minutes - but I've seen it take an hour or even more before for a new block to be found (so probably nothing going wrong at either site).

At other times you might see as much as 6 new blocks found within 10 minutes.


Title: Re: Latest block hash
Post by: gmaxwell on September 13, 2013, 04:47:42 PM
You can get it out of bitcoind and bitcoin-qt.


Title: Re: Latest block hash
Post by: crazydownloaded on September 16, 2013, 05:54:40 PM
Using bitcoind:

./bitcoind getblockcount
=> returns something like 258345

./bitcoind getblockhash 258345
=> returns the hash of the latest block like 000000000000001bca1bfe721ecf4fb6480835d966762bc840689ed86642c7b6

./bitcoind getblock 000000000000001bca1bfe721ecf4fb6480835d966762bc840689ed86642c7b6
=> returns the block in JSON format


Another possibility, use my service: http://coinplorer.com/BTC (http://coinplorer.com/BTC) ; I'm currently improving the importation delays and will soon offer a push API to be notified of new blocks (websockets).
Coinplorer importation status can be found here: http://coinplorer.com/Console/Status2 (http://coinplorer.com/Console/Status2), updated in real time (but still some delay between importations, will be solved very soon).

If the blockchain changes (because I don't wait for the confirmations to come), the previous blocks gets deleted and replaced by the new ones!