最近,博主有几个闲置的机子一直在挖XMR,感觉收益并不高,挖了一个月,才0.1个XMR,1K的算力。
下面来介绍一下在Linux上需要用到的工具:

  1. 挖矿程序(这里推荐用xmr-stack-cpu)
  2. 矿池(我用的supportxmr)
  3. 一台服务器(最好CPU支持aes算法)
  4. 钱包(挖少量的建议用MyMonero,此网站需要记下你的KEY来登录)
    • *

挖矿程序的安装

系统优化

LIMIT='262144'
sed -i '/^vm.nr_hugepages.*/d' /etc/sysctl.conf
echo -ne '\nvm.nr_hugepages=128\n' >>/etc/sysctl.conf
sed -i '/^\(\*\|root\).*\(hard\|soft\).*memlock/d' /etc/security/limits.conf
echo -ne "*\thard\tmemlock\t$LIMIT\n*\tsoft\tmemlock\t$LIMIT\nroot\thard\tmemlock\t$LIMIT\nroot\tsoft\tmemlock\t$LIMIT\n" >>/etc/security/limits.conf
sysctl -p

Centos

yum install centos-release-scl cmake3 hwloc-devel libmicrohttpd-devel openssl-devel -y
yum install devtoolset-4-gcc* -y
scl enable devtoolset-4 bash
wget https://cmake.org/files/v3.11/cmake-3.11.0-rc3.tar.gz
tar -zxf cmake-3.11.0-rc3.tar.gz
cd cmake-3.11.0-rc3
./configure
make -j 4 && make install
cd
wget https://github.com/fireice-uk/xmr-stak-cpu/archive/v1.3.0-1.5.0.tar.gz
tar -zxf v1.3.0-1.5.0.tar.gz
cd xmr-stak-cpu-1.3.0-1.5.0
/usr/local/bin/cmake .
make install
ln -s /root/xmr-stak-cpu-1.3.0-1.5.0/bin/xmr-stak-cpu /usr/bin/xmr
cp /root/xmr-stak-cpu-1.3.0-1.5.0/bin/config.txt /root/config.txt

Ubuntu

add-apt-repository ppa:ubuntu-toolchain-r/test
apt update
apt install gcc-5 g++-5 make -y
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 1 --slave /usr/bin/g++ g++ /usr/bin/g++-5
curl -L http://www.cmake.org/files/v3.4/cmake-3.4.1.tar.gz | tar -xvzf - -C /tmp/
cd /tmp/cmake-3.4.1/ && ./configure && make && sudo make install && cd -
update-alternatives --install /usr/bin/cmake cmake /usr/local/bin/cmake 1 --force
apt install libmicrohttpd-dev libssl-dev libhwloc-dev -y
cd
wget https://github.com/fireice-uk/xmr-stak-cpu/archive/v1.3.0-1.5.0.tar.gz
tar -zxf v1.3.0-1.5.0.tar.gz
cd xmr-stak-cpu-1.3.0-1.5.0
cmake .
make install
ln -s /root/xmr-stak-cpu-1.3.0-1.5.0/bin/xmr-stak-cpu /usr/bin/xmr
cp /root/xmr-stak-cpu-1.3.0-1.5.0/bin/config.txt /root/config.txt

Debian

apt install libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev -y
cd
wget https://github.com/fireice-uk/xmr-stak-cpu/archive/v1.3.0-1.5.0.tar.gz
tar -zxf v1.3.0-1.5.0.tar.gz
cd xmr-stak-cpu-1.3.0-1.5.0
cmake .
make install
ln -s /root/xmr-stak-cpu-1.3.0-1.5.0/bin/xmr-stak-cpu /usr/bin/xmr
cp /root/xmr-stak-cpu-1.3.0-1.5.0/bin/config.txt /root/config.txt

然后在root目录下运行“xmr”命令,把显示的两个Copy&Paste;之间的内容复制到config.txt相应的位置。
安装管理脚本

    wget --no-check-certificate https://raw.githubusercontent.com/Thnineer/Bash/master/init/xmr -qO /etc/init.d/xmr
chmod +x /etc/init.d/xmr
update-rc.d -f xmr remove >/dev/null 2>&1
update-rc.d xmr defaults
mkdir -p ~/.xmr
chmod -R a+x ~/.xmr

矿池的配置可以参考supportxmr.com。
然后,就可到矿池查看收益啦。

最后修改:2024 年 04 月 16 日
如果觉得我的文章对你有用,请随意赞赏