鍍金池/ 問答/C++  Linux/ 運行 btcpool的測試測序simulator出錯

運行 btcpool的測試測序simulator出錯

運行simpler

./simulator -c simulator.cfg -l log_simulator/

這個程序本身沒有運行報錯,它的日志也沒有什么有用信息,但是礦機(jī)模擬連接不上sserver

運行sserver

運行sserver查看其日志

tail -f run_sserver/log_sserver/sserver.INFO

I0410 11:21:28.801024  9178 StratumServer.cc:1136] socket closed
I0410 11:21:28.801419  9178 StratumSession.cc:246] client connect, ip: 127.0.0.1
W0410 11:21:28.802170  9178 StratumServer.cc:128] getLatestStratumJobEx fail

運行minerd

minerd -o stratum+tcp://127.0.0.1:3333 -O aaa:1

日志信息:

[2018-04-10 11:21:28] Stratum connection timed out
[2018-04-10 11:21:28] Stratum connection interrupted

進(jìn)展

追了下源碼,發(fā)現(xiàn)是kafkaConsumer獲取topic: StratumJob 里面的message時,此message->err = -191(Reached the end of the topic+partition queue on the broker. Not really an error.)。意思應(yīng)該是此topic隊列里面沒有數(shù)據(jù)。

------------------------------過程重演------------------------------
1.運行sserver

./sserver -c sserver.cfg -l log_sserver/ &

2.運行simulator

./simulator -c simulator.cfg -l log_simulator/ &

3.運行minerd

minerd -o stratum+tcp://127.0.0.1:3333 -O mmm:1

----------------sserver的日志-----------------------------------------

  2 Running on machine: zc-x0
  3 Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
  4 W0413 09:53:53.061329 29478 StratumServerMain.cc:122] using bitcoin testnet3
  5 W0413 09:53:53.152810 29478 StratumServer.cc:868] Simulator is enabled, all share will be accepted
  6 I0413 09:53:53.153057 29478 Kafka.cc:354] producer librdkafka version: 0.9.1
  7 I0413 09:53:53.153143 29478 Kafka.cc:354] producer librdkafka version: 0.9.1
  8 I0413 09:53:53.153200 29478 Kafka.cc:354] producer librdkafka version: 0.9.1
  9 I0413 09:53:53.153249 29478 Kafka.cc:354] producer librdkafka version: 0.9.1
 10 I0413 09:53:53.153296 29478 Kafka.cc:354] producer librdkafka version: 0.9.1
 11 I0413 09:53:53.153347 29478 Kafka.cc:82] consumer librdkafka version: 0.9.1
 12 I0413 09:53:53.153933 29478 Kafka.cc:166] add brokers: 127.0.0.1:9092
 13 I0413 09:53:53.154124 29478 Kafka.cc:173] create topic handle: StratumJob
 14 I0413 09:53:53.186662 29485 StratumServer.cc:162] start job repository consume thread
 15 I0413 09:53:53.587468 29478 StratumServer.cc:557] update users count: 6
 16 I0413 09:53:53.706065 29478 Kafka.cc:424] add brokers: 127.0.0.1:9092
 17 I0413 09:53:53.706281 29478 Kafka.cc:431] create topic handle: ShareLog
 18 I0413 09:53:53.737315 29478 Kafka.cc:424] add brokers: 127.0.0.1:9092
 19 I0413 09:53:53.737399 29478 Kafka.cc:431] create topic handle: SolvedShare
 20 I0413 09:53:53.768941 29478 Kafka.cc:424] add brokers: 127.0.0.1:9092
 21 I0413 09:53:53.769235 29478 Kafka.cc:431] create topic handle: NMCSolvedShare
 22 I0413 09:53:53.801560 29478 Kafka.cc:424] add brokers: 127.0.0.1:9092
 23 I0413 09:53:53.801816 29478 Kafka.cc:431] create topic handle: RskSolvedShare
 24 I0413 09:53:53.833838 29478 Kafka.cc:424] add brokers: 127.0.0.1:9092
 25 I0413 09:53:53.834085 29478 Kafka.cc:431] create topic handle: CommonEvents
 26 I0413 09:53:54.329674 29485 StratumServer.cc:189] ####consumeStratumJob,189### zhh_deubg ###
 27 I0413 09:53:54.329761 29485 StratumServer.cc:191] ####consumeStratumJob,191### zhh_deubg ###, the rkmessage->err =-191
 28 I0413 09:53:54.329784 29485 StratumServer.cc:199] ###zhh_debug### the message is err!!
 29 I0413 09:53:58.481243 29478 StratumSession.cc:246] client connect, ip: 127.0.0.1
 30 I0413 09:53:58.481425 29478 StratumSession.cc:246] client connect, ip: 127.0.0.1
 31 I0413 09:53:58.481523 29478 StratumSession.cc:246] client connect, ip: 127.0.0.1
 32 I0413 09:53:58.481583 29478 StratumSession.cc:246] client connect, ip: 127.0.0.1
 33 I0413 09:53:58.481637 29478 StratumSession.cc:246] client connect, ip: 127.0.0.1
 34 I0413 09:53:58.481695 29478 StratumSession.cc:246] client connect, ip: 127.0.0.1
 35 I0413 09:53:58.481750 29478 StratumSession.cc:246] client connect, ip: 127.0.0.1
 36 I0413 09:53:58.481848 29478 StratumSession.cc:246] client connect, ip: 127.0.0.1
 37 I0413 09:53:58.481969 29478 StratumSession.cc:246] client connect, ip: 127.0.0.1
 38 I0413 09:53:58.482046 29478 StratumSession.cc:246] client connect, ip: 127.0.0.1
 39 I0413 09:53:58.482400 29478 StratumSession.cc:374] ####zhh_debug## StratumSession## method: mining.subscribe
40 I0413 09:53:58.482625 29478 StratumSession.cc:374] ####zhh_debug## StratumSession## method: mining.subscribe
 41 I0413 09:53:58.482702 29478 StratumSession.cc:374] ####zhh_debug## StratumSession## method: mining.subscribe
 42 I0413 09:53:58.482758 29478 StratumSession.cc:374] ####zhh_debug## StratumSession## method: mining.subscribe
 43 I0413 09:53:58.482820 29478 StratumSession.cc:374] ####zhh_debug## StratumSession## method: mining.subscribe
 44 I0413 09:53:58.482882 29478 StratumSession.cc:374] ####zhh_debug## StratumSession## method: mining.subscribe
 45 I0413 09:53:58.482955 29478 StratumSession.cc:374] ####zhh_debug## StratumSession## method: mining.authorize
 46 I0413 09:53:58.483037 29478 StratumSession.cc:608] ###zhh_debug###handleRequest_Authorize, 608
 47 W0413 09:53:58.483059 29478 StratumServer.cc:128] getLatestStratumJobEx fail
 48 I0413 09:53:58.483392 29478 StratumSession.cc:374] ####zhh_debug## StratumSession## method: mining.subscribe
 49 I0413 09:53:58.483469 29478 StratumSession.cc:374] ####zhh_debug## StratumSession## method: mining.subscribe
 50 I0413 09:53:58.483522 29478 StratumSession.cc:374] ####zhh_debug## StratumSession## method: mining.subscribe
 51 I0413 09:53:58.483785 29478 StratumSession.cc:374] ####zhh_debug## StratumSession## method: mining.subscribe
 52 I0413 09:53:58.483983 29478 StratumSession.cc:374] ####zhh_debug## StratumSession## method: mining.authorize
 53 I0413 09:53:58.484081 29478 StratumSession.cc:608] ###zhh_debug###handleRequest_Authorize, 608
 54 W0413 09:53:58.484169 29478 StratumServer.cc:128] getLatestStratumJobEx fail
 55 I0413 09:53:58.484263 29478 StratumSession.cc:374] ####zhh_debug## StratumSession## method: mining.authorize
 56 I0413 09:53:58.484331 29478 StratumSession.cc:608] ###zhh_debug###handleRequest_Authorize, 608
 57 W0413 09:53:58.484374 29478 StratumServer.cc:128] getLatestStratumJobEx fail
 58 I0413 09:53:58.484499 29478 StratumSession.cc:374] ####zhh_debug## StratumSession## method: mining.authorize
 59 I0413 09:53:58.484599 29478 StratumSession.cc:608] ###zhh_debug###handleRequest_Authorize, 608
 60 W0413 09:53:58.484647 29478 StratumServer.cc:128] getLatestStratumJobEx fail
 61 I0413 09:53:58.484753 29478 StratumSession.cc:374] ####zhh_debug## StratumSession## method: mining.authorize
 62 I0413 09:53:58.484848 29478 StratumSession.cc:608] ###zhh_debug###handleRequest_Authorize, 608
 63 W0413 09:53:58.484896 29478 StratumServer.cc:128] getLatestStratumJobEx fail
 64 I0413 09:53:58.485008 29478 StratumSession.cc:374] ####zhh_debug## StratumSession## method: mining.authorize
 65 I0413 09:53:58.485096 29478 StratumSession.cc:608] ###zhh_debug###handleRequest_Authorize, 608
 66 W0413 09:53:58.485143 29478 StratumServer.cc:128] getLatestStratumJobEx fai
回答
編輯回答
檸檬藍(lán)

simulater就是模擬的礦機(jī),不需要再運行minerd去測試

2018年5月15日 19:39