How does blockchaininfo find out the difficulty?

3

0

Do they have a client installed on their servers that pulls the info out of block headers? How does it do it? What's the command?

Kinnard Hockenhull

Posted 2012-12-07T05:34:58.387

Reputation: 2 285

Answers

1

Blockchain.info definitely has a client installed on their servers, that's where they get all the block data from. I heard they're using a fork of BitcoinJ.

In the Bitcoin-qt daemon, you can get the difficulty of the latest block with the getdifficulty command, and you can get complete information about every block, including the difficulty, with getblock.

Meni Rosenfeld

Posted 2012-12-07T05:34:58.387

Reputation: 18 542

@KinnardHockenhull Open up spotlight and type in "terminal" for the command line. If your bitcoind instance has JSON-RPC enabled through config you can use CURL to access the datagoodguys_activate 2013-03-03T23:22:18.530

Or just open the regular QT client and click help : Debug Window : Console. You can use most of the commands right there if youre running 7.xgoodguys_activate 2013-03-03T23:23:56.080

How would I do it without a UI, say, if I installed bitcoind on my server?Kinnard Hockenhull 2012-12-07T07:08:40.990

If you can access it with a CLI, you can go to the daemon directory and run bitcoind.exe with the required command as a parameter. Other than that there's something called JSON-RPC but I don't really know what that is.Meni Rosenfeld 2012-12-07T07:54:27.080

Drats, I have a Mac . . .Kinnard Hockenhull 2012-12-14T02:44:52.027

@KinnardHockenhull: Are you talking about a computer you have locally? I don't know how Macs work, but doesn't it have a command prompt?Meni Rosenfeld 2012-12-14T04:37:50.967