How do I get testnet block height?

3

Like I would do wget -O - http://blockchain.info/q/getblockcount 2>/dev/null for the main net.

o0'.

Posted 2013-06-17T14:23:16.627

Reputation: 5 180

Answers

4

Blockchain.info does not track the testnet, but blockexplorer.com does. In fact the API you're using was originally from blockexplorer.com, and blockchain.info simply adopted it.

wget -O - http://blockexplorer.com/testnet/q/getblockcount 2> /dev/null

or shorter

curl http://blockexplorer.com/testnet/q/getblockcount

cdecker

Posted 2013-06-17T14:23:16.627

Reputation: 7 878

1this doesn't work anymore :( gives a 502...knocte 2016-06-27T07:13:57.497

0

BlockExplorer doesn't work anymore for me (redirecting to testnet.blockexplorer.com which throws a 502) so I found a new alternative:

http://tbtc.blockr.io/api/v1/coin/info

You have to get the "last_block" element.

(For mainnet: http://btc.blockr.io/api/v1/coin/info)

knocte

Posted 2013-06-17T14:23:16.627

Reputation: 1 531