Hack Forums
monero pool extract difficulty from job sent - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Money (https://hackforums.net/forumdisplay.php?fid=241)
+--- Forum: Crypto Currency (https://hackforums.net/forumdisplay.php?fid=380)
+--- Thread: monero pool extract difficulty from job sent (/showthread.php?tid=6190783)



monero pool extract difficulty from job sent - Fhack - Jan 26, 2022

Hello i wonder how to get job difficulty from data sent by the pool :

Code
{"id":1,"jsonrpc":"2.0","error":null,"result":{"id":"300955505552701","job": {"blob":"0202b4d88cd005723910a7844c6cf04bb10af456fdf6e4b352e1839747d3e971117b7550da82550000000028b751d55f1b5c591ef82e4ec90a621a32f48044e8e112fa8ff4be5b3b046a6a04","job_id":"129359229584224","target":"9bc42000"},"status":"OK"}}

Does there is a way to extract difficulty from this ? because it's showned on xmrig so i wonder how they do that !

Found the solution in python :

Code
def _getDifficulty(self):
        target = int(self.target, 16)
        diff = struct.unpack("<I", struct.pack(">I", target))[0]
        return int(0x100000001 / int(diff))



RE: monero pool extract difficulty from job sent - jasonmugler - Jan 27, 2022

Brother i would like to buy a lifetime licence, I wrote you on discord. Can you there online? Please. Thank you