bonesoul / node-hpool-stratum

Stratum protocol module for hpool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support NiceHash Miners (Mining.Extranonce.Subscribe)

ahmedbodi opened this issue · comments

Add stratum mining.extranonce.subscribe method
Uppon successful subscription to stratum with "mining.subscribe" method, client should send "mining.extranonce.subscribe" method.

{"id": X, "method": "mining.extranonce.subscribe", "params": []}\n

This informs the server (pool) that client (miner) supports extranonce1 change on-the-fly without the need to reestablish connection. Servers supporting this method will reply:

{"id": X, "result": true, "error": null}\n

If the server does not support method, reply will be:

{"id": X, "result": false, "error": [20, "Not supported.", null]}\n

Server may also simply ignore this subscription and return no reply or return invalid method. Some pools may return incorrectly formed error message. Some pools may drop connection (in such cases, it is best to offer user a way to turn extranonce subscriptions off for certain pools - via config for example). In all cases, client does not perform any logic when receiving back these replies. With mining.extranonce.subscribe subscription, client should handle extranonce1 changes correctly. Server would send:

{"id": null, "method": "mining.set_extranonce", "params": ["08000002", 4]}\n

First parameter is string extranonce1 value, second parameter is integer value of extranonce2 size. Miner shall start using new extranonce1 when new job is provided with mining.notify.

i think this problem is not really relevant to CoiniumServ or other Pools...

Miners who connect to Nicehash can use mining.extranonce.subscribe.

But Nicehash will not send mining.extranonce.subscribe to pools.
at least i did not see it yet in my stratum protocol analysis - it only sends:
{"id":0,"method":"mining.subscribe","params":["NiceHash/1.0.0"]}

i just solved it in coinium c# version by removing json.ignore attribute of "Error" field in json response class.

hmmm 1,5 years later. and nicehash dont connect to my Coniumserv
can you descripe what you remove ?

@frndxyz I am interested about the solution too... Could you please share what you've changed? Or at least in what file it was... 🙂