I know I have to somehow implement this spec but other than that I'm not sure.
Any help/resources is appreciated.
Monero Stack Exchange is a question and answer site for developers and users of the secure, private and untraceable cryptocurrency Monero. It only takes a minute to sign up.
Sign up to join this communityYou'd modify def pack_nonce
to account for the Nicehash nonce byte. I.e. only pack 3 bytes.
E.g.
diff --git a/stratum-miner.py b/stratum-miner.py index 486e877..ec3ae5f 100644 --- a/stratum-miner.py +++ b/stratum-miner.py @@ -99,8 +99,8 @@ def main(): def pack_nonce(blob, nonce): b = binascii.unhexlify(blob) bin = struct.pack('39B', *bytearray(b[:39])) - bin += struct.pack('I', nonce) - bin += struct.pack('{}B'.format(len(b)-43), *bytearray(b[43:])) + bin += struct.pack('I', nonce & 0x00ffffff)[:3] + bin += struct.pack('{}B'.format(len(b)-42), *bytearray(b[42:])) return bin @@ -146,6 +146,7 @@ def worker(q, s): elapsed = time.time() - started hr = int(hash_count / elapsed) print('{}Hashrate: {} H/s'.format(os.linesep, hr)) + nonce = struct.unpack('I', bin[39:43])[0] submit = { 'method':'submit', 'params': {
Or simply using the latest version with the --nicehash
flag.
'nonce': binascii.hexlify(struct.pack('<I', nonce)).decode(),
Line after: 'nonce': nonce,
nonce = struct.unpack('I', bin[40:44])[0]