cnetos7使用CPU挖矿: xmrig编译教程

最近流行挖矿,显卡价格暴涨.
没有显卡,就用CPU挖矿吧.

先升级GCC 8


GCC 9无法编译,GCC 8就好
yum install -y centos-release-scl
yum install -y devtoolset-8-toolchain
scl enable devtoolset-8 bash

系统安装依赖文件

yum install -y  git make cmake gcc gcc-c++ libstdc++-static libuv-static hwloc-devel openssl-devel
yum install -y  git make cmake3 gcc gcc-c++ libstdc++-static automake libtool autoconf

克隆xmrig并且编译


git clone https://github.com/xmrig/xmrig.git
cd xmrig
sed -i "[email protected] = [email protected] = [email protected]"  src/donate.h
sed -i "[email protected] = [email protected] = [email protected]"  src/donate.h
sed -i "[email protected]@[email protected]"  src/net/strategies/DonateStrategy.cpp
sed -i "[email protected]@[email protected]"  src/net/strategies/DonateStrategy.cpp
mkdir build
cd scripts && ./build_deps.sh && cd ../build
cmake .. -DXMRIG_DEPS=scripts/deps -DCMAKE_BUILD_TYPE=Release
make  -j$(nproc)

运行编译完成的xmrig


./xmrig --cpu-max-threads-hint 100 --donate-level 0 -o mine_pool:3333 -u 钱包地址 -k

CPU挖矿玩玩就好. 如果没有高性能硬件,电费都赚不回来

参考:
https://github.com/xmrig/xmrig/blob/master/src/config.json
https://xmrig.com/docs/miner/build

发表评论