惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
Hugging Face - Blog
Hugging Face - Blog
L
LINUX DO - 热门话题
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
D
Docker
C
Cyber Attacks, Cyber Crime and Cyber Security
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
T
Tenable Blog
P
Privacy International News Feed
Google DeepMind News
Google DeepMind News
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
Arctic Wolf
C
Cybersecurity and Infrastructure Security Agency CISA
C
Cisco Blogs
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
The Hacker News
The Hacker News
Project Zero
Project Zero
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
V
Visual Studio Blog
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
Last Week in AI
Last Week in AI
Jina AI
Jina AI
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
MongoDB | Blog
MongoDB | Blog
U
Unit 42
Scott Helme
Scott Helme
A
About on SuperTechFans
WordPress大学
WordPress大学
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
G
GRAHAM CLULEY
Latest news
Latest news
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Schneier on Security

Rat's Blog - Monero

MinerGate:在Windows、Mac、Ubuntu、安卓手机上挖矿教程 - Rat's Blog Windows一键傻瓜式免编译Monero矿机,并用CPU挖矿Monero - Rat's Blog
CentOS/Debian系统下,使用CPU挖Monero (XMR)币 - Rat's Blog
博主: Rat's · 2017-12-15 · via Rat's Blog - Monero

说明:最近挖矿教程发了不少,参考:MinerGate:在Windows、Mac、Ubuntu、安卓手机上挖矿教程CentOS 7下莱特币(Litecoin)挖矿教程,现在再发个Ubuntu/CentOS/Debian系统的挖矿教程,这里最好使用独立服务器挖,VPS尽量别尝试,不然会被商家停止or删除。要是你的VPS多,不在乎,那就限制CPU后再挖,参考:Linux VPS通过安装CPULimit来限制CPU使用率,这里就说下教程。

教程

1、获取钱包地址
钱包地址获取途径有很多,这里建议去https://hitbtc.com注册个账号,然后进入后台点击Account然后往下找到Monero货币并获取钱包地址,即Wallet address
请输入图片描述

2、Payment-ID获取
在服务器上运行以下命令:

openssl rand -hex 32

请输入图片描述
即可获取Payment-ID也就是支付ID

3、安装挖矿程序
这里建议使用Ubuntu系统,听说效率更高。

#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

4、设置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:端口就可以查看运行情况

也可用以下代码替换:

"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

5、开始挖矿
运行命令:

cd /root/xmr-stak/bin
screen -S mine
./xmr-stak-cpu

即可后台开始挖矿。

常见问题

#如何更改捐赠比例
编辑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
然后重启或者注销并重新登录。

文章来源:使用闲置服务器的CPU算力挖掘Monero
部分参考:独立服务器Ubuntu系统下,使用CPU挖XMR币


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/449/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。