Insight - Automated Stratum V2 mining pool for Nervos

Hey! Thanks for asking.

Well yes and no… all seems to be running, I modified the database a little bit (still need more updates) miner-list does not work properly, only alice and bob work, if I rebuild the docker still does not allow to add more users, last but now least, if I try to connect to my asic miner I can see it in the log of btcpool like this:

btcpool_1     | I0315 00:48:26.847534     8 StratumSessionCkb.cc:160] receive handleRequest_Subscribe jparams : ["GodMiner/2.0.0",null]
btcpool_1     | I0315 00:48:26.847616     8 StratumSessionCkb.cc:175] send mining  :{"id":1,"result":["null","000004",5],"error":null}
btcpool_1     | I0315 00:48:26.869228     8 StratumServer.cc:1187] socket closed

But never authorize it, if I use the ckb-miner it works (only with alice or bob) , I mean it is authorized but then it does not work.

from the asic miner side this is what I get:

JSON-RPC call failed: [
   2147483647,
   "Unknown",
   null
], req_id=1"

I tried 0.103.0 and 0.108.0 not worked, I also tried:

of course I run cargo updates.
explored with this:

this is a log snapshot of how it is running right now:

btcpool_1     | I0321 14:46:52.782593     9 StratumServer.cc:367] remove expired stratum job, id: 7213009789624778753, time: 2023-03-21 14:41:52
jobmaker_1    | I0321 14:46:53.735181    19 JobMaker.cc:121] received CkbRawGw message len: 286
jobmaker_1    | I0321 14:46:53.735239    19 JobMakerCkb.cc:88] remove timeout work: 2023-03-21 14:45:53|1679409953, height:9456218, headerHash:0x299ebf6ef3b02b67a72287948e2d7c5ff7b4cb8b276715b1eaad480d18ad7d53
jobmaker_1    | I0321 14:46:53.735283    19 JobMaker.cc:127] handleMsg returns true, new stratum job
jobmaker_1    | I0321 14:46:53.735299    19 JobMaker.cc:139] new CkbJob job: {"created_at_ts":1679410007,"work_id":36980,"jobid":7213011056640131073,"pow_hash":"0xbd419d242780d5bd3895102ac4cd97747a1af8bef624401c3add900ac64574ad","parent_hash":"0x8659b37dbd09d3f9ef2e47a4faf4d3edc0722eef78d7cc7e26bddd06afcfa019","height":9456223,"target":"0xa158b00000000000000000000000000000000000000000000","timestamp":1679410007720}
btcpool_1     | E0321 14:46:53.798205     9 StratumServer.cc:310] jobId already existed
btcpool_1     | I0321 14:46:54.808806     9 StratumServer.cc:367] remove expired stratum job, id: 7213009798214713345, time: 2023-03-21 14:41:54
ckb-node_1    | 2023-03-21 14:46:55.306 +00:00 ChainService INFO ckb_chain::chain  block: 9456223, hash: 0xb9b4b0cda4cc71e5c5a61241cf89d84b2886c6ec2f65dc84baab2cf69d178d40, epoch: 7303(1233/1394), total_diff: 0x4d556516ef4f3fa0d888e, txs: 1
ckb-node_1    | 2023-03-21 14:46:55.749 +00:00 GlobalRt-8 INFO ckb_tx_pool::process  [get_block_template] candidate txs count: 6, size: 51089/596370, cycles:20258483/3500000000
jobmaker_1    | I0321 14:46:55.763341    19 JobMaker.cc:121] received CkbRawGw message len: 286
jobmaker_1    | I0321 14:46:55.763382    19 JobMakerCkb.cc:88] remove timeout work: 2023-03-21 14:45:55|1679409955, height:9456218, headerHash:0xe3dfb9ca729495d6e3c06ec631338f5239a0756af9d8ca69d3591a0aa102e366
jobmaker_1    | I0321 14:46:55.763432    19 JobMaker.cc:127] handleMsg returns true, new stratum job
jobmaker_1    | I0321 14:46:55.763440    19 JobMaker.cc:139] new CkbJob job: {"created_at_ts":1679410015,"work_id":36982,"jobid":7213011090999869441,"pow_hash":"0xcf4d6293ee3505cc0723401d00b6a3d6c3875e4ce5fa307a44e2cf947ff4df28","parent_hash":"0xb9b4b0cda4cc71e5c5a61241cf89d84b2886c6ec2f65dc84baab2cf69d178d40","height":9456224,"target":"0xa158b00000000000000000000000000000000000000000000","timestamp":1679410015750}
btcpool_1     | I0321 14:46:55.841632     9 StratumServerCkb.cc:181] broadcast stratum job 6419c35f00000001
btcpool_1     | I0321 14:46:55.841667     9 StratumServerCkb.cc:188] received new height stratum job, height: 9456224, hash: 0xcf4d6293ee3505cc0723401d00b6a3d6c3875e4ce5fa307a44e2cf947ff4df28
jobmaker_1    | I0321 14:46:57.765517    19 JobMaker.cc:121] received CkbRawGw message len: 286
jobmaker_1    | I0321 14:46:57.765570    19 JobMakerCkb.cc:88] remove timeout work: 2023-03-21 14:45:57|1679409957, height:9456218, headerHash:0x60246eb89558b0f93d82e92b24829ea918d2b2636c2811997ddc59bdb5eafefc
jobmaker_1    | I0321 14:46:57.765590    19 JobMaker.cc:127] handleMsg returns true, new stratum job
jobmaker_1    | I0321 14:46:57.765640    19 JobMaker.cc:139] new CkbJob job: {"created_at_ts":1679410015,"work_id":36982,"jobid":7213011090999869441,"pow_hash":"0xcf4d6293ee3505cc0723401d00b6a3d6c3875e4ce5fa307a44e2cf947ff4df28","parent_hash":"0xb9b4b0cda4cc71e5c5a61241cf89d84b2886c6ec2f65dc84baab2cf69d178d40","height":9456224,"target":"0xa158b00000000000000000000000000000000000000000000","timestamp":1679410015750}
btcpool_1     | E0321 14:46:57.846483     9 StratumServer.cc:310] jobId already existed

obmaker_1    | I0321 14:49:54.457437    19 JobMaker.cc:139] new CkbJob job: {"created_at_ts":1679410192,"work_id":37019,"jobid":7213011851209080833,"pow_hash":"0xaeaff853aefaae4eb93f4b9693d4fad44bff46c1e87df849898d61cdccb4ec22","parent_hash":"0xcc83e88557a41a600824103bd68e51b0156405e7ed515fbbf6d9d244269474d6","height":9456244,"target":"0xa158b00000000000000000000000000000000000000000000","timestamp":1679410192445}
btcpool_1     | E0321 14:49:54.511085     9 StratumServer.cc:310] jobId already existed
btcpool_1     | I0321 14:49:55.521283     9 StratumServer.cc:367] remove expired stratum job, id: 7213010575603793921, time: 2023-03-21 14:44:55
btcpool_1     | I0321 14:49:55.521646     9 StratumSession.cc:104] client connect, ip: (HIDDEN)
btcpool_1     | I0321 14:49:55.524391     9 StratumSessionCkb.cc:160] receive handleRequest_Subscribe jparams : ["GodMiner/2.0.0",null]
btcpool_1     | I0321 14:49:55.524417     9 StratumSessionCkb.cc:175] send mining  :{"id":1,"result":["null","00000d",5],"error":null}
btcpool_1     | I0321 14:49:55.551331     9 StratumServer.cc:1187] socket closed
jobmaker_1    | I0321 14:49:56.460327    19 JobMaker.cc:121] received CkbRawGw message len: 286
jobmaker_1    | I0321 14:49:56.460424    19 JobMakerCkb.cc:88] remove timeout work: 2023-03-21 14:48:56|1679410136, height:9456239, headerHash:0xa4dc1323d3f9b95e040e25fc6496d7ac11b665ad9ef55a339b45c1be03cae79e
jobmaker_1    | I0321 14:49:56.460456    19 JobMaker.cc:127] handleMsg returns true, new stratum job
jobmaker_1    | I0321 14:49:56.460485    19 JobMaker.cc:139] new CkbJob job: {"created_at_ts":1679410192,"work_id":37019,"jobid":7213011851209080833,"pow_hash":"0xaeaff853aefaae4eb93f4b9693d4fad44bff46c1e87df849898d61cdccb4ec22","parent_hash":"0xcc83e88557a41a600824103bd68e51b0156405e7ed515fbbf6d9d244269474d6","height":9456244,"target":"0xa158b



jobmaker_1    | I0321 14:50:16.527736    19 JobMaker.cc:127] handleMsg returns true, new stratum job
jobmaker_1    | I0321 14:50:16.527745    19 JobMaker.cc:139] new CkbJob job: {"created_at_ts":1679410192,"work_id":37019,"jobid":7213011851209080833,"pow_hash":"0xaeaff853aefaae4eb93f4b9693d4fad44bff46c1e87df849898d61cdccb4ec22","parent_hash":"0xcc83e88557a41a600824103bd68e51b0156405e7ed515fbbf6d9d244269474d6","height":9456244,"target":"0xa158b00000000000000000000000000000000000000000000","timestamp":1679410192445}
btcpool_1     | E0321 14:50:16.543165     9 StratumServer.cc:310] jobId already existed
btcpool_1     | I0321 14:50:16.543277     9 StratumSession.cc:108] close stratum session, ip: (HIDDEN), name: "", agent: "GodMiner/2.0.0"
btcpool_1     | I0321 14:50:16.543285     9 StratumSession.cc:108] close stratum session, ip: (HIDDEN), name: "", agent: "GodMiner/2.0.0"
btcpool_1     | I0321 14:50:17.554550     9 StratumServer.cc:367] remove expired stratum job, id: 7213010670093074433, time: 2023-03-21 14:45:17

I think database and code needs to be updated for the net RPCs and fix the miner-list thing.

Any help will be really appreciated.

Thank you!