连接到NODEJS中的Stratum服务器

时间:2020-10-18 19:05:33

标签: node.js stratum

我正在尝试几天以连接到nodejs中的层服务器。但是我没有使我的代码正常工作。 我尝试了几个npm软件包,但其中大多数已过时。 然后我发现了node-stratum

此软件包在本地可以正常运行,因此我希望它也可以与远程服务器一起使用。 在将端口号为pool.minexmr.com的主机和端口更改为4444

之后

我收到此错误消息

Oops error:  Error: Stratum request without method or result field
at serverForEachCommand (C:\Users\JP\Documents\xmr-web\node_modules\stratum\lib\server.js:350:19)
at arrayEach (C:\Users\JP\Documents\xmr-web\node_modules\stratum\node_modules\lodash\index.js:1289:13)
at Function.<anonymous> (C:\Users\JP\Documents\xmr-web\node_modules\stratum\node_modules\lodash\index.js:3345:13)
at Object.processCommands (C:\Users\JP\Documents\xmr-web\node_modules\stratum\lib\server.js:298:9)
at Object.handleData (C:\Users\JP\Documents\xmr-web\node_modules\stratum\lib\client.js:138:38)
at Socket.twoArgs (C:\Users\JP\Documents\xmr-web\node_modules\better-curry\index.js:74:18)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:271:9)
at Socket.Readable.push (_stream_readable.js:212:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23)

我曾经在示例/客户端中编写代码 我的完整代码在这里codepile

我还尝试将主机更改为miningpoolhub,但没有错误,并且以console.log('Sent!')停止,因此我发现我最好坚持使用pool.minexmr.com

在代码堆中,我还从终端添加了其他日志

1 个答案:

答案 0 :(得分:0)

好的,终于我得到了答案。 门罗币层的有效负载与比特币不同 使用Wireshark,我将有效负载过滤掉,从而更改了客户端代码van node-stratum。 我也更改了节点层核心代码。

相关问题