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 而後重啓或者註銷並從新登陸。