Open anemol opened 6 years ago
For some reason, i need to change the worker's name & password on the fly.
I tried to intercept mining.authorize and mining.submit methods but the miner program (minerd) doesn't want to work normally.
self.socket.on('data', function(data) { var json=JSON.parse(data.toString()); if (json.method=='mining.authorize') { json.params[0]='newWorker'; json.params[1]='x'; self.onServerData(Buffer.from(JSON.stringify(json))); } else if (json.method=='mining.submit') { json.params[0]='newWorker'; self.onServerData(Buffer.from(JSON.stringify(json))); } else self.onServerData(data); });
Any idea how to do this feature?
Finally found the problem. Have to add a \n
self.onServerData(Buffer.from(JSON.stringify(json))+'\n');
For some reason, i need to change the worker's name & password on the fly.
I tried to intercept mining.authorize and mining.submit methods but the miner program (minerd) doesn't want to work normally.
Any idea how to do this feature?