[Solved] Calculating of stats - View source of Stats page shows Calculation Code
-
Merry Christmas again,
I’ve been working for 2 hours now to write some mathematical functions to calculate the Feathercoin stats as you can see them here: [url=http://www.feathercoin.com/netstats/]http://www.feathercoin.com/netstats/[/url]I’m almost done, except two values:
- Next Difficulty
- Current Network Hashrate (Its possible to get that value via the RPC-API but there have to be a way to get that value via a mthematical function right?)
Thanks in Advance
-
let me bump this for you :)
-
Did you think of any new Stats that might be usefull?
-
Well it’s not the question how much these functions or their results are useful or not. It would be good to know how they will be calculated.
If you opening the calculator [url=http://www.feathercoin.com/calc/]http://www.feathercoin.com/calc/[/url] you can find the JavaScript functions in its page-sources which makes it transparent for everyone. -
Yours might not be a question of what might be useful or not but mine was. As I was interested in the opinion of some one who was interacting with the API. I would like to see it improve if possible, and be able to inform other members about it. Especially as I haven’t had chance to study it.
I also couldn’t understand wither you were reproducing some statistics or were proporting to develop them, so asked a qualitative question to try to illicit more details of the “problem”.
-
In both cases your mathematical calculation will only be a rough approximation (does that make sense? *lol).
IMHO there would be no other way than comparing the target block generation speed (time) vs actual block generation speed since e.g. last retarget or last [i]n[/i] blocks etc. The closer you get to the next retarget, the more accurate your approximation - at least for next difficulty.
Personally I would go with api calls. Beeing a php/py guy I did like the jsonRPCClient class and the json-rpc lib. Both are really super easy to use/integrate and there are several available for other languages too.
I’ve tried both before I moved to my own little curl/curlmulti based class. But that was just personal preference b/c I was used to grabbing data from lots of urls in parallel for forum signature generators, google kwt data etc. and I’m grabbing data from different qt clients as well.