Skip to content

使用miner连接到矿池挖矿

BigBang-Core edited this page Dec 6, 2019 · 3 revisions

BigBang挖矿简介

XMRig 是一个高性能的RandomX 和 CryptoNight挖矿程序,我们这里使用的是CPU的版本。由于我们的BigBang所使用的POW hash算法是CryptoNight,所以针对BigBang的挖矿也可以使用XMRig来进行。

配置需要

操作系统:ubuntu16.04及以上  
CPU:inter core i3及以上  
内存:4G  
硬盘:20G  
网络带宽:200Kbps  

源代码

地址:https://github.com/bigbangcore/miner    
下载源码:git clone https://github.com/bigbangcore/miner.git   

编译

sudo apt-get install git build-essential cmake libuv1-dev libssl-dev libhwloc-dev  
git clone https://github.com/bigbangcore/miner.git  
cd xmrig && mkdir build && cd build  
cmake ..  
make  

可执行程序下载

地址:https://github.com/bigbangcore/miner/releases  

修改配置文件

开始挖矿的首选方法是使用配置文件JSON config file,因为它更灵活和人性化。虽然使用命令行也能启动程序,但是它不包括所有功能。例如为不同算法设置配置文件,而且重要选项可以在程序运行过程中通过修改配置文件或执行API调用来完成,而无需重新启动miner。配置文件的内容如下:

{
    "api": {
        "id": null,
        "worker-id": null
    },
    "http": {
        "enabled": false,
        "host": "127.0.0.1",
        "port": 0,
        "access-token": null,
        "restricted": true
    },
    "autosave": true,
    "version": 1,
    "background": false,
    "colors": true,
    "randomx": {
        "init": -1,
        "numa": true
    },
    "cpu": {
        "enabled": true,
        "huge-pages": true,
        "hw-aes": null,
        "priority": null,
        "asm": true,
        "argon2-impl": null,
        "cn/bbc": [
            0,
            1,
            2,
            3
        ]
    },
    "donate-level": 1,
    "donate-over-proxy": 1,
    "log-file": null,
    "pools": [
        {
            "algo": "cn/bbc",
            "url": "bbc01.bbcpool.io:3333",
            "user": "1dtxf4e89n52eyttgnwhrjwgesez3edk8k9gfcjfq94yas0qb4j67vqz7",
            "pass": "x",
            "rig-id": "my name",
            "nicehash": true,
            "keepalive": true,
            "enabled": true,
            "tls": false,
            "tls-fingerprint": null,
            "daemon": false
        }
    ],
    "print-time": 60,
    "retries": 5,
    "retry-pause": 5,
    "syslog": false,
    "user-agent": null,
    "watch": true
}

需要修改的参数:

"background": false, # 是否在后台运行程序,true:在后台运行,false:在前台运行
"cn/bbc": [ # 配置多线程对应的CPU号,CPU号从0开始
  0, # CPU 0
  1, # CPU 1
  2, # CPU 2
  3  # CPU 3
]
"user": "1tp1qxcytshfdyn64yxd5hra6bx2f5qzbxnhvwhgchggwnxzkp29k29ee", # 填写接收BBC的地址
"rig-id": "my name", # 填写自已的名字

执行选项

  -a, --algo=ALGO               specify the algorithm to use
                                  cn/r, cn/2, cn/1, cn/0, cn/double, cn/half, cn/fast,
                                  cn/rwz, cn/zls, cn/xao, cn/rto, cn/gpu,
                                  cn-lite/1,
                                  cn-heavy/xhv, cn-heavy/tube, cn-heavy/0,
                                  cn-pico,
                                  rx/wow, rx/loki
  -o, --url=URL                 URL of mining server
  -O, --userpass=U:P            username:password pair for mining server
  -u, --user=USERNAME           username for mining server
  -p, --pass=PASSWORD           password for mining server
      --rig-id=ID               rig identifier for pool-side statistics (needs pool support)
  -t, --threads=N               number of miner threads
  -v, --av=N                    algorithm variation, 0 auto select
  -k, --keepalive               send keepalived packet for prevent timeout (needs pool support)
      --nicehash                enable nicehash.com support
      --tls                     enable SSL/TLS support (needs pool support)
      --tls-fingerprint=F       pool TLS certificate fingerprint, if set enable strict certificate pinning
      --daemon                  use daemon RPC instead of pool for solo mining
      --daemon-poll-interval=N  daemon poll interval in milliseconds (default: 1000)
  -r, --retries=N               number of times to retry before switch to backup server (default: 5)
  -R, --retry-pause=N           time to pause between retries (default: 5)
      --cpu-affinity            set process affinity to CPU core(s), mask 0x3 for cores 0 and 1
      --cpu-priority            set process priority (0 idle, 2 normal to 5 highest)
      --no-huge-pages           disable huge pages support
      --no-color                disable colored output
      --donate-level=N          donate level, default 5% (5 minutes in 100 minutes)
      --user-agent              set custom user-agent string for pool
  -B, --background              run the miner in the background
  -c, --config=FILE             load a JSON-format configuration file
  -l, --log-file=FILE           log all output to a file
      --asm=ASM                 ASM optimizations, possible values: auto, none, intel, ryzen, bulldozer.
      --print-time=N            print hashrate report every N seconds
      --api-worker-id=ID        custom worker-id for API
      --api-id=ID               custom instance ID for API
      --http-enabled            enable HTTP API
      --http-host=HOST          bind host for HTTP API (default: 127.0.0.1)
      --http-port=N             bind port for HTTP API
      --http-access-token=T     access token for HTTP API
      --http-no-restricted      enable full remote access to HTTP API (only if access token set)
      --randomx-init=N          threads count to initialize RandomX dataset
      --randomx-no-numa         disable NUMA support for RandomX
      --export-topology         export hwloc topology to a XML file and exit
      --dry-run                 test configuration and exit
  -h, --help                    display this help and exit
  -V, --version                 output version information and exit

开始挖矿

如果配置文件与您的可执行程序在同一个目录下,您可以使用下边的方法开始挖矿:

./xmrig -c config.json  

查询挖矿奖励

您可以点击这里登录到矿池,点击链接 worker statistics,然后输入您的钱包地址,就可以查看奖励相关数据了。

Clone this wiki locally