文章

xmr-stak架设教程。

  编辑于:2018-01-21

Ubuntu / Debian v1.01(安装好之后运行填好六个问题就可以运行了)

#更新系统
sudo apt-get --assume-yes update
sudo apt-get --assume-yes upgrade
#安装需要插件
sudo apt-get --assume-yes install libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev screen git nano htop wget curl
#查看自己主机IP
curl -4 icanhazip.com
#开启大内存和memlock
sysctl -w vm.nr_hugepages=128
sed -i '1s/^/vm.nr_hugepages=128\n/' /etc/sysctl.conf
echo '* soft memlock 262144' >> /etc/security/limits.conf
echo '* hard memlock 262144' >> /etc/security/limits.conf
#下载&安装最新版XMR-Stak
git clone https://github.com/fireice-uk/xmr-stak.git
cd xmr-stak/
cmake . -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF
make install
cd bin/
./xmr-stak

解除Linux系统的Spectre/Meltdown补丁

#检查Linux内核版本
uname -a
#如果内核是4.13.0-26的话,就需要解除了
sudo apt-get remove linux-image-4.13.0-26-generic && sudo apt autoremove -y
sudo update-grub

以下是只安装挖矿程式
Ubuntu / Debian

sudo apt-get --assume-yes install libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev screen git nano htop
git clone https://github.com/fireice-uk/xmr-stak.git
cd xmr-stak/
cmake . -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF
make install
cd bin/
./xmr-stak

CentOS

rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install centos-release-scl cmake3 hwloc-devel libmicrohttpd-devel openssl-devel git screen nano make htop
yum -y install devtoolset-4-gcc*
scl enable devtoolset-4 bash
git clone https://github.com/fireice-uk/xmr-stak.git
cd xmr-stak/
cmake3 . -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF
make install
cd bin/
./xmr-stak

修改捐赠(不建议):将 xmr-stak/xmrstak/donate-level.hpp 中的 2.0 改为 0.0

优化:

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

原文链接:http://www.hostloc.com/forum.php?mod=viewthread&tid=415078&highlight=xmr%2Bstak

发表回复