[英]Validate mining share in NodeJS before submit to pool (Stratum)
[英]Connect to stratum server in NODEJS
我嘗試了幾天連接到 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)
我曾經在示例/客戶端中編碼我的完整代碼在這里代碼堆
我也嘗試將主機更改為 Miningpoolhub,但沒有出現錯誤,並且它通過console.log('Sent!')
停止,所以我發現我最好堅持使用pool.minexmr.com
在代碼堆中,我還添加了來自終端的其他日志
好吧,我終於得到了答案。 Monero 層具有與比特幣不同的有效負載 使用 Wireshark 我過濾掉有效負載並更改了客戶端代碼 van node-stratum。 我也稍微更改了節點層核心代碼。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.