nightminer
nightminer copied to clipboard
RPC handler error
The script has an issue when ran with Python 2.7.13
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "nightminer.py", line 648, in _handle_incoming_rpc
output += '\n ' + e.reply
TypeError: cannot concatenate 'str' and 'dict' objects
+1
output += '\n ' + str(e.reply)
Script does not work.
{'params': ['NightMiner/0.1'], 'method': 'mining.subscribe', 'id': 1}
{u'jsonrpc': u'2.0', u'id': 1, u'error': {u'message': u'Procedure not found.', u'code': -32601}}
Sorry, I haven't really paid attention to this in quite some time. Did the stratum protocol change?
Yes, the protocol has changed, now you need to log in and get a job
{"jsonrpc": "2.0", "id": 1, "method": "login", "params": {"login": "", "pass": "", "agent": "NightMiner/0.1"}}
response
{"jsonrpc":"2.0","result":{"job":{"blob":"060681eff5cd05345337affbe243531444b4c9a39f4f3f9f78ec40df35f07191b2d0dc4654b44f000000000e5f94b68a6ac56a5ff1d6b715795a72be98685800c18283264591416e6aa63501","target":"e4a63d00","job_id":"c8b5ea1d-ad7d-4e6a-9241-22c7033a35ba","time_to_live":5},"status":"OK","id":"a010b632-b750-4362-9053-0f69b5e2f84e"},"id":1,"error":null}