Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: gri0 on May 31, 2014, 08:05:31 AM



Title: How to get current Net Hashrate by PHP?
Post by: gri0 on May 31, 2014, 08:05:31 AM
Hello!
I want to get some stats for the crypto currency.
Tell me please, is it possible to get current Net Hashrate by PHP?
Or I need to parse some third party sites for it?



Title: Re: How to get current Net Hashrate by PHP?
Post by: jonald_fyookball on May 31, 2014, 01:57:50 PM
There is no way to measure it directly because you're
talking about the sum of all miners across the global
bitcoin network.  The best you can do is to calculate
an estimate based on the current difficulty level and the time
between blocks, and of course it is always changing.

If you don't already have a PHP code library which
parses the blockchain, then the easiest thing
to do is probably use an API service such as
the one provided by blockchain.info.


Title: Re: How to get current Net Hashrate by PHP?
Post by: gri0 on May 31, 2014, 02:36:48 PM
Thanks, Jonald!
The problem is I need to get the difficulty levels from some different cryptocurrencies.
And there is not service such as blockchain.info for them.
Maybe some of them do not have a block explorer yet :)
What is the way to get info in this case?
I mean, the service like a whattomine.com, how they get the levels and rates?


Title: Re: How to get current Net Hashrate by PHP?
Post by: jonald_fyookball on May 31, 2014, 03:04:59 PM
other cryptocurrencies use different blockchain and different code.
The code should be open source for each currency.

Some currencies change difficulty every block.  In most
cases, I think the difficulty level is at least stored in
each block.  So you will have to write your own code
to check this if the code isn't out there.