p4u / stratum-relay

Stratum proxy relay for mining altcoin
GNU Affero General Public License v3.0
43 stars 36 forks source link

Hashrate #12

Open Aziz87 opened 1 year ago

Aziz87 commented 1 year ago

Hello @p4u tell me please, how i can get hashrate of worker?

i know, i can call echo '{ "query":"getshares" }' | nc 127.0.0.1 4444 but it return only shares, i don't know how convert shares to hashrate )

p4u commented 1 year ago

Wow, does this code still work? I made it 9 years ago...

To be honest, I don't remember exactly how to compute the hashrate from shares. However, I do believe you would need the difficulty in order to compute the hashrate. It should be something like this:

hashRate= (difficulty × number of shares) / time

The result of this forumla whould be Hashes/second, so you might want to transform it to Mega or Giga Hashes.

Good luck.