CentOS7(增长源)git
yum repolist # 查看yum源列表 yum localinstall http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm -y yum makecache # 将服务器上的软件包信息下载到本地缓存, 以提升搜索和安装软件的速度 yum repolist # 能够再次查看新加入的列表 yum install pptpd -y # 再次执行安装pptpd ------------------------------------或 yum install -y http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
二、Payment-ID获取
在服务器上运行如下命令:github
openssl rand -hex 32
便可获取Payment-ID
也就是支付ID
。ubuntu
三、安装挖矿程序
这里建议使用Ubuntu
系统,据说效率更高。centos
#Ubuntu系统,在Ubuntu 14.04测试成功 add-apt-repository ppa:ubuntu-toolchain-r/test apt update apt install gcc-5 g++-5 make 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 git clone https://github.com/fireice-uk/xmr-stak-cpu xmr-stak cd xmr-stak cmake . make install #CentOS系统 yum install centos-release-scl cmake3 hwloc-devel libmicrohttpd-devel openssl-devel yum install devtoolset-4-gcc* scl enable devtoolset-4 bash git clone https://github.com/fireice-uk/xmr-stak-cpu xmr-stak cd xmr-stak cmake3 . make install #Debian系统,在Debian 8测试成功 echo "deb http://ftp.us.debian.org/debian unstable main contrib non-free" >> /etc/apt/sources.list.d/unstable.list apt-get update apt-get install -t unstable gcc-5 g++-5 make 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 && make install && cd - update-alternatives --install /usr/bin/cmake cmake /usr/local/bin/cmake 1 --force apt install libmicrohttpd-dev libssl-dev libhwloc-dev git clone https://github.com/fireice-uk/xmr-stak-cpu xmr-stak cd xmr-stak cmake . make install
四、设置CPU、钱包、Payment-ID
在/root/xmr-stak/bin/config.txt
设置CPU
、钱包、Payment-ID
。缓存
#修改CPU信息 cpu_threads_conf部分,建议CPU核数的50% #修改钱包、Payment-ID、矿工号和Email地址 wallet_address后面的。 #修改pool_address 改成本身服务器近的。 #修改httpd_port 改成本身喜欢的端口,而后使用IP:端口就能够查看运行状况
也可用如下代码替换:bash
"cpu_threads_conf" : [ { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 0 }, { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 2 }, { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 4 }, { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 6 }, ], "use_slow_memory" : "warn", "nicehash_nonce" : false, "aes_override" : null, "use_tls" : false, "tls_secure_algo" : true, "tls_fingerprint" : "", "pool_address" : "xmr-us-east1.nanopool.org:14444", "wallet_address" : "钱包地址.Payment-ID.矿工编号/Email", #矿工编号能够随便填 "pool_password" : "x", "call_timeout" : 10, "retry_time" : 10, "giveup_limit" : 0, "verbose_level" : 3, "h_print_time" : 60, "daemon_mode" : false, "output_file" : "", "httpd_port" : 1024, "prefer_ipv4" : true,
Monero
矿池有不少,官网http://moneropools.com/
中列举了不少个矿池,能够选择想加入的矿池。我这里选择的是xmr.nanopool.org
。服务器
五、开始挖矿
运行命令:curl
cd /root/xmr-stak/bin screen -S mine ./xmr-stak-cpu
便可后台开始挖矿。ide
#如何更改捐赠比例 编辑xmr-stak下的donate-level.h文件,把 constexpr double fDevDonationLevel = 2.0 / 100.0; 改成 constexpr double fDevDonationLevel = 0.5 / 100.0; 也能够改成其余比例。 #Linux下挖矿出现MEMORY ALLOC FAILED: mmap failed错误 运行命令: sysctl -w vm.nr_hugepages=128 而后编辑文件/etc/security/limits.conf, 在倒数第二行或者以前加入下面两行: soft memlock 262144 hard memlock 262144 而后重启或者注销并从新登陆。