编译挖矿xmr – 取消donate

参考 https://xmrig.com/docs/miner/build/ubuntu

mkdir -p /data/xmr && cd /data/xmr

# prepare to compile
apt update -y && apt install -y git build-essential cmake libuv1-dev libssl-dev libhwloc-dev
git clone https://github.com/xmrig/xmrig.git
mkdir xmrig/build && cd xmrig/build

# change donation level to 0
sed -i.bak 's/kDefaultDonateLevel = 1/kDefaultDonateLevel = 0/g' ../src/donate.h
sed -i.bak 's/kMinimumDonateLevel = 1/kMinimumDonateLevel = 0/g'  ../src/donate.h

cmake ..
make -j$(nproc)

mv xmrig ../../xmbin && cd ../../

# prepare 
cat > ./config.json <<EOF
{
    "autosave": true,
    "cpu": true,
    "opencl": false,
    "cuda": false,
    "pools": [
        {
            "url": "sg.minexmr.com:443",
            "user": "49LtY9iWMS6C3SgSFrgcpRe7Z8wgPZYRDZDCU7VnngpeJqPWanpJy6NK46FKva1Qd4KeAombFMiH47FZXZ2Yj4dASZXvQiL",
            "rig-id": "$(hostname)",
            "keepalive": true,
            "tls": true
        }
    ]
}
EOF

# run 
./xmbin -c config.json

Leave a Reply