Skip to content

请教关于使用mergeminingproxy模块联合挖矿的问题 #20

@EthanHee

Description

@EthanHee

使用 mergeminingproxy 模块 连接 namecoin 和 ela 节点进行联合挖矿时, mergeminingproxy 只能从其中的一个节点获取到任务(Chains 中的第一个节点)。

还请大佬帮忙解答一下。

mergeminingproxy 的配置如下:

{
    "RPCServer": {
        "ListenAddr": "0.0.0.0:8999",
        "User": "admin",
        "Passwd": "admin",
        "MainChain":"BTC",
        "PoolDb": {
            "host" : "127.0.0.1",
            "port" : "3306",
            "username" : "root",
            "password" : "root",
            "dbname" : "pool_btc_db"
        }
    },
    "AuxJobMaker": {
        "CreateAuxBlockIntervalSeconds": 5,
        "AuxPowJobListSize": 1000,
        "MaxJobTarget": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
        "BlockHashPublishPort": "5555"
    },
    "Chains": [
        {
            "Name": "Elastos",
            "AuxTableName" :"found_Elastos_blocks",
            "RPCServer":{
                "URL": "http://127.0.0.1:21336/",
                "User": "User",
                "Passwd": "Password"
            },
            "CreateAuxBlock": {
                "Method": "createauxblock",
                "Params": {
                    "paytoaddress": "EdvnvJK8wFB7iWRb7Kd3xy41p21XaN7LNN"
                },
                "ResponseKeys": {
                    "Hash": "hash",
                    "ChainID": "chainid",
                    "Bits": "bits",
                    "Height": "height",
                    "PrevBlockHash": "previousblockhash",
                    "CoinbaseValue": "coinbasevalue"
                }
            },
            "SubmitAuxBlock": {
                "Method": "submitauxblock",
                "Params": {
                    "blockhash": "{hash-hex}",
                    "auxpow": "{aux-pow-hex}"
                }
            }
        },
        {
            "Name": "Namecoin",
            "AuxTableName" :"found_nmc_blocks",
            "IsSupportZmq" : true,
            "SubBlockHashAddress" : "0.0.0.0",
            "SubBlockHashPort" :"8337",
            "RPCServer":{
                "URL": "http://127.0.0.1:8336/",
                "User": "bitcoinrpc",
                "Passwd": "DXvQsIQlTQzu73q0WdzMvMLsxvhjUX"
            },
            "CreateAuxBlock": {
                "Method": "getauxblock",
                "Params": [],
                "ResponseKeys": {
                    "Hash": "hash",
                    "ChainID": "chainid",
                    "Bits": "bits",
                    "Height": "height",
                    "PrevBlockHash": "previousblockhash",
                    "CoinbaseValue": "coinbasevalue"
                }
            },
            "SubmitAuxBlock": {
                "Method": "getauxblock",
                "Params": [
                    "{hash-hex}",
                    "{aux-pow-hex}"
                ]
            }
        }
    ]
}

mergeminingproxy 的日志如下:

-> # tail mergedMiningProxy.INFO -f    
I0622 18:25:49.225429   21086 ProxyRPC.go:162] [CreateAuxBlock] height:565415, bits:1a0c5585, target:0000000000000c55850000000000000000000000000000000000000000000000, coinbaseValue:175851586, hash:5554679508cbce3102ab03b0a4fdc74b8448135fe0985c1bbf5652a0c22d3cbd, prevHash:f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95, merkleSize: 2, merkleNonce: 2596996162
I0622 18:25:59.226918   21086 AuxJobMaker.go:102] [GetAuxJob] job not changed
I0622 18:25:59.226927   21086 ProxyRPC.go:162] [CreateAuxBlock] height:565415, bits:1a0c5585, target:0000000000000c55850000000000000000000000000000000000000000000000, coinbaseValue:175851586, hash:5554679508cbce3102ab03b0a4fdc74b8448135fe0985c1bbf5652a0c22d3cbd, prevHash:f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95, merkleSize: 2, merkleNonce: 2596996162
I0622 18:26:09.228374   21086 ProxyRPC.go:162] [CreateAuxBlock] height:565415, bits:1a0c5585, target:0000000000000c55850000000000000000000000000000000000000000000000, coinbaseValue:175851586, hash:c492e858a903fb3e691f677c0630b86928b0b975fbf1e444078e5ce8ea2bc883, prevHash:f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95, merkleSize: 2, merkleNonce: 2596996162
I0622 18:26:19.229924   21086 AuxJobMaker.go:102] [GetAuxJob] job not changed
I0622 18:26:19.229931   21086 ProxyRPC.go:162] [CreateAuxBlock] height:565415, bits:1a0c5585, target:0000000000000c55850000000000000000000000000000000000000000000000, coinbaseValue:175851586, hash:c492e858a903fb3e691f677c0630b86928b0b975fbf1e444078e5ce8ea2bc883, prevHash:f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95, merkleSize: 2, merkleNonce: 2596996162
I0622 18:26:29.231374   21086 AuxJobMaker.go:102] [GetAuxJob] job not changed
I0622 18:26:29.231381   21086 ProxyRPC.go:162] [CreateAuxBlock] height:565415, bits:1a0c5585, target:0000000000000c55850000000000000000000000000000000000000000000000, coinbaseValue:175851586, hash:c492e858a903fb3e691f677c0630b86928b0b975fbf1e444078e5ce8ea2bc883, prevHash:f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95, merkleSize: 2, merkleNonce: 2596996162
I0622 18:26:39.232826   21086 AuxJobMaker.go:102] [GetAuxJob] job not changed
I0622 18:26:39.232833   21086 ProxyRPC.go:162] [CreateAuxBlock] height:565415, bits:1a0c5585, target:0000000000000c55850000000000000000000000000000000000000000000000, coinbaseValue:175851586, hash:c492e858a903fb3e691f677c0630b86928b0b975fbf1e444078e5ce8ea2bc883, prevHash:f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95, merkleSize: 2, merkleNonce: 2596996162
I0622 18:26:49.234416   21086 ProxyRPC.go:162] [CreateAuxBlock] height:565415, bits:1a0c5585, target:0000000000000c55850000000000000000000000000000000000000000000000, coinbaseValue:175851586, hash:60eb2866f91af1ce71da563e96681a066afdd008522495213b79c733f5f53c4b, prevHash:f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95, merkleSize: 2, merkleNonce: 2596996162
I0622 18:26:59.235994   21086 AuxJobMaker.go:102] [GetAuxJob] job not changed
I0622 18:26:59.236002   21086 ProxyRPC.go:162] [CreateAuxBlock] height:565415, bits:1a0c5585, target:0000000000000c55850000000000000000000000000000000000000000000000, coinbaseValue:175851586, hash:60eb2866f91af1ce71da563e96681a066afdd008522495213b79c733f5f53c4b, prevHash:f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95, merkleSize: 2, merkleNonce: 2596996162
I0622 18:27:09.237838   21086 AuxJobMaker.go:102] [GetAuxJob] job not changed
I0622 18:27:09.237846   21086 ProxyRPC.go:162] [CreateAuxBlock] height:565415, bits:1a0c5585, target:0000000000000c55850000000000000000000000000000000000000000000000, coinbaseValue:175851586, hash:60eb2866f91af1ce71da563e96681a066afdd008522495213b79c733f5f53c4b, prevHash:f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95, merkleSize: 2, merkleNonce: 2596996162

nmcauxmaker配置如下:

#
# namecoin aux block maker
#
# @since 2016-09
# @copyright btc.com
#

nmcauxmaker = {
  # rpc call interval seconds
  rpcinterval = 10;
  # write last rpc call time to file
  file_last_rpc_call_time = "/work/btcpool/build/run_nmcauxmaker/nmcauxmaker_lastrpccalltime.txt";

  # check zmq when startup
  is_check_zmq = true;

  #
  # nmc coinbase payout address
  # the private key of my2dxGb5jz43ktwGxg2doUaEb9WhZ9PQ7K is cQAiutBRMq4wwC9JHeANQLttogZ2EXw9AgnGXMq5S3SAMmbX2oLd
  payout_address = "tb1qw4tfgucaac8dwk8xgq4dkjqzcg96acea8nsnm7";

  # kafka topic
  auxpow_gw_topic = "AuxPowBlock"; // kafka topic of merge mining auxpow work
};

namecoind = {
  # namecoind MUST with zmq options: -zmqpubhashblock, -zmqpubhashtx
  # '-zmqpubhashtx' will use to check zmq is working when startup
  zmq_addr = "tcp://192.168.20.229:8337";
  # reconnect if no new messages are received after the following number of seconds
  zmq_timeout = 1200;

  #
  # rpc settings
  #
  # WARNING: this ip & host will be used by `blkmaker` to submit nmc block,
  #          so make sure blkmaker could access this ip & port. Don't put '"',
  #          '\\' characters like that because they make json decode failure.
  #
  # rpc_addr    = "http://192.168.20.229:8336";
  # rpc_userpwd = "namecoinrpc:DXvQsIQlTQzu73q0WdzMvMLsxvhjUX";  # username:password

  rpc_addr    = "http://192.168.20.229:8999";
  rpc_userpwd = "admin:admin";  # username:password
};

kafka = {
  brokers = "kfk1:9092"; # "10.0.0.1:9092,10.0.0.2:9092,..."
};

nmcauxmaker日志如下:

-> # tail -f nmcauxmaker.INFO      
I0622 10:26:19.230229    10 GbtMaker.cc:599] sumbit to Kafka, msg len: 269
I0622 10:26:29.231487    10 GbtMaker.cc:515] createauxblock json: {"id":"1","result":{"hash":"83c82beae85c8e0744e4f1fb75b9b02869b830067c671f693efb03a958e892c4","chainid":1,"previousblockhash":"f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95","coinbasevalue":175851586,"bits":"1a0c5585","height":565415,"_target":"000000000000000000000000000000000000000000000085550c000000000000","merkle_size":2,"merkle_nonce":2596996162},"error":null}
I0622 10:26:29.231628    10 GbtMaker.cc:577] createauxblock, height: 565415, hash: 83c82beae85c8e0744e4f1fb75b9b02869b830067c671f693efb03a958e892c4, previousblockhash: f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95
I0622 10:26:29.231645    10 GbtMaker.cc:599] sumbit to Kafka, msg len: 269
I0622 10:26:39.232996    10 GbtMaker.cc:515] createauxblock json: {"id":"1","result":{"hash":"83c82beae85c8e0744e4f1fb75b9b02869b830067c671f693efb03a958e892c4","chainid":1,"previousblockhash":"f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95","coinbasevalue":175851586,"bits":"1a0c5585","height":565415,"_target":"000000000000000000000000000000000000000000000085550c000000000000","merkle_size":2,"merkle_nonce":2596996162},"error":null}
I0622 10:26:39.233187    10 GbtMaker.cc:577] createauxblock, height: 565415, hash: 83c82beae85c8e0744e4f1fb75b9b02869b830067c671f693efb03a958e892c4, previousblockhash: f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95
I0622 10:26:39.233206    10 GbtMaker.cc:599] sumbit to Kafka, msg len: 269
I0622 10:26:49.234556    10 GbtMaker.cc:515] createauxblock json: {"id":"1","result":{"hash":"4b3cf5f533c7793b2195245208d0fd6a061a68963e56da71cef11af96628eb60","chainid":1,"previousblockhash":"f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95","coinbasevalue":175851586,"bits":"1a0c5585","height":565415,"_target":"000000000000000000000000000000000000000000000085550c000000000000","merkle_size":2,"merkle_nonce":2596996162},"error":null}
I0622 10:26:49.234755    10 GbtMaker.cc:577] createauxblock, height: 565415, hash: 4b3cf5f533c7793b2195245208d0fd6a061a68963e56da71cef11af96628eb60, previousblockhash: f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95
I0622 10:26:49.234773    10 GbtMaker.cc:599] sumbit to Kafka, msg len: 269
I0622 10:26:59.236104    10 GbtMaker.cc:515] createauxblock json: {"id":"1","result":{"hash":"4b3cf5f533c7793b2195245208d0fd6a061a68963e56da71cef11af96628eb60","chainid":1,"previousblockhash":"f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95","coinbasevalue":175851586,"bits":"1a0c5585","height":565415,"_target":"000000000000000000000000000000000000000000000085550c000000000000","merkle_size":2,"merkle_nonce":2596996162},"error":null}
I0622 10:26:59.236260    10 GbtMaker.cc:577] createauxblock, height: 565415, hash: 4b3cf5f533c7793b2195245208d0fd6a061a68963e56da71cef11af96628eb60, previousblockhash: f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95
I0622 10:26:59.236279    10 GbtMaker.cc:599] sumbit to Kafka, msg len: 269
I0622 10:27:09.238034    10 GbtMaker.cc:515] createauxblock json: {"id":"1","result":{"hash":"4b3cf5f533c7793b2195245208d0fd6a061a68963e56da71cef11af96628eb60","chainid":1,"previousblockhash":"f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95","coinbasevalue":175851586,"bits":"1a0c5585","height":565415,"_target":"000000000000000000000000000000000000000000000085550c000000000000","merkle_size":2,"merkle_nonce":2596996162},"error":null}
I0622 10:27:09.238206    10 GbtMaker.cc:577] createauxblock, height: 565415, hash: 4b3cf5f533c7793b2195245208d0fd6a061a68963e56da71cef11af96628eb60, previousblockhash: f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95
I0622 10:27:09.238226    10 GbtMaker.cc:599] sumbit to Kafka, msg len: 269
I0622 10:27:19.239436    10 GbtMaker.cc:515] createauxblock json: {"id":"1","result":{"hash":"6262ee5af4fa8244534937af22a9c353d1e35db975f0b266dcca3254da6ccd65","chainid":1,"previousblockhash":"f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95","coinbasevalue":175851586,"bits":"1a0c5585","height":565415,"_target":"000000000000000000000000000000000000000000000085550c000000000000","merkle_size":2,"merkle_nonce":2596996162},"error":null}
I0622 10:27:19.239578    10 GbtMaker.cc:577] createauxblock, height: 565415, hash: 6262ee5af4fa8244534937af22a9c353d1e35db975f0b266dcca3254da6ccd65, previousblockhash: f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95
I0622 10:27:19.239595    10 GbtMaker.cc:599] sumbit to Kafka, msg len: 269
I0622 10:27:29.240818    10 GbtMaker.cc:515] createauxblock json: {"id":"1","result":{"hash":"6262ee5af4fa8244534937af22a9c353d1e35db975f0b266dcca3254da6ccd65","chainid":1,"previousblockhash":"f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95","coinbasevalue":175851586,"bits":"1a0c5585","height":565415,"_target":"000000000000000000000000000000000000000000000085550c000000000000","merkle_size":2,"merkle_nonce":2596996162},"error":null}
I0622 10:27:29.240965    10 GbtMaker.cc:577] createauxblock, height: 565415, hash: 6262ee5af4fa8244534937af22a9c353d1e35db975f0b266dcca3254da6ccd65, previousblockhash: f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95
I0622 10:27:29.240983    10 GbtMaker.cc:599] sumbit to Kafka, msg len: 269
I0622 10:27:39.242247    10 GbtMaker.cc:515] createauxblock json: {"id":"1","result":{"hash":"6262ee5af4fa8244534937af22a9c353d1e35db975f0b266dcca3254da6ccd65","chainid":1,"previousblockhash":"f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95","coinbasevalue":175851586,"bits":"1a0c5585","height":565415,"_target":"000000000000000000000000000000000000000000000085550c000000000000","merkle_size":2,"merkle_nonce":2596996162},"error":null}
I0622 10:27:39.242348    10 GbtMaker.cc:577] createauxblock, height: 565415, hash: 6262ee5af4fa8244534937af22a9c353d1e35db975f0b266dcca3254da6ccd65, previousblockhash: f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95
I0622 10:27:39.242365    10 GbtMaker.cc:599] sumbit to Kafka, msg len: 269
I0622 10:27:49.243575    10 GbtMaker.cc:515] createauxblock json: {"id":"1","result":{"hash":"6262ee5af4fa8244534937af22a9c353d1e35db975f0b266dcca3254da6ccd65","chainid":1,"previousblockhash":"f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95","coinbasevalue":175851586,"bits":"1a0c5585","height":565415,"_target":"000000000000000000000000000000000000000000000085550c000000000000","merkle_size":2,"merkle_nonce":2596996162},"error":null}
I0622 10:27:49.243680    10 GbtMaker.cc:577] createauxblock, height: 565415, hash: 6262ee5af4fa8244534937af22a9c353d1e35db975f0b266dcca3254da6ccd65, previousblockhash: f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95
I0622 10:27:49.243697    10 GbtMaker.cc:599] sumbit to Kafka, msg len: 269
I0622 10:27:59.244948    10 GbtMaker.cc:515] createauxblock json: {"id":"1","result":{"hash":"695b30b86debfbfaa88c31b5188d2a883606cacd916e11e167222d047a2a077c","chainid":1,"previousblockhash":"f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95","coinbasevalue":175851586,"bits":"1a0c5585","height":565415,"_target":"000000000000000000000000000000000000000000000085550c000000000000","merkle_size":2,"merkle_nonce":2596996162},"error":null}
I0622 10:27:59.245107    10 GbtMaker.cc:577] createauxblock, height: 565415, hash: 695b30b86debfbfaa88c31b5188d2a883606cacd916e11e167222d047a2a077c, previousblockhash: f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95
I0622 10:27:59.245146    10 GbtMaker.cc:599] sumbit to Kafka, msg len: 269
I0622 10:28:09.246399    10 GbtMaker.cc:515] createauxblock json: {"id":"1","result":{"hash":"695b30b86debfbfaa88c31b5188d2a883606cacd916e11e167222d047a2a077c","chainid":1,"previousblockhash":"f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95","coinbasevalue":175851586,"bits":"1a0c5585","height":565415,"_target":"000000000000000000000000000000000000000000000085550c000000000000","merkle_size":2,"merkle_nonce":2596996162},"error":null}
I0622 10:28:09.246570    10 GbtMaker.cc:577] createauxblock, height: 565415, hash: 695b30b86debfbfaa88c31b5188d2a883606cacd916e11e167222d047a2a077c, previousblockhash: f2b455e07627eb080953223c6c40dcd014d1d469c4d8463fe5829b8821d66a95
I0622 10:28:09.246589    10 GbtMaker.cc:599] sumbit to Kafka, msg len: 269

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions