轻松搞定门罗币挖矿「实战篇」
![](https://pic.rmb.bdstatic.com/bjh/user/743a7d81e995ca7de5ff760614556c5b.jpeg?x-bce-process=image/resize,m_lfit,w_200,h_200&autime=43676)
![](https://pics4.baidu.com/feed/42a98226cffc1e17721ea8eeabf9e109718de9c4.jpeg?token=0164aa8ac22660682b5051f248841a1a)
因公众号粉丝留言说门罗币挖坑遇到很多坑,故而实战此篇仅作技术交流及内容留存。
基于Linux平台
测试环境
Ubuntu 18.04 LTS
Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz 单核
修改本地源
因国内阿里、清华及其他旧的源均存在一些坑点,经过测试建议设置如下源
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to# newer versions of the distribution.deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted## Major bug fix updates produced after the final release of the## distribution.deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu## team. Also, please note that software in universe WILL NOT receive any## review or updates from the Ubuntu security team.deb http://us.archive.ubuntu.com/ubuntu/ bionic universe# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universedeb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu## security team.deb http://us.archive.ubuntu.com/ubuntu/ bionic multiverse# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiversedeb http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse## N.B. software from this repository may not have been tested as## extensively as that contained in the main release, although it includes## newer versions of some applications which may provide useful features.## Also, please note that software in backports WILL NOT receive any review## or updates from the Ubuntu security team.# deb http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse## Uncomment the following two lines to add software from Canonical's## 'partner' repository.## This software is not part of Ubuntu, but is offered by Canonical and the## respective vendors as a service to Ubuntu users.# deb http://archive.canonical.com/ubuntu bionic partner# deb-src http://archive.canonical.com/ubuntu bionic partnerdeb http://security.ubuntu.com/ubuntu bionic-security main restricted# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricteddeb http://security.ubuntu.com/ubuntu bionic-security universe# deb-src http://security.ubuntu.com/ubuntu bionic-security universedeb http://security.ubuntu.com/ubuntu bionic-security multiverse# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse环境部署apt-get updateapt-get upgra -yapt-get install git build-essential cmake libuv1-dev libssl-dev libhwloc-devgit clone https://github.com/xmrig/xmrig.gitmkdir xmrig/build && cd xmrig/buildcmake ..make -j$(nproc)自定义赞助费cd xmrig/srcvim donate.h将如下内容修改为0或自定义
constexpr const int kDefaultDonateLevel = 0;constexpr const int kMinimumDonateLevel = 0;![](https://pics1.baidu.com/feed/8718367adab44aedcd98b03f6975900ba38bfb8f.jpeg?token=82d37c81bca22422aa689b8bc58b67fd)
配置向导
进入 https://xmrig.com/wizard 选择New configuration
![](https://pics4.baidu.com/feed/a2cc7cd98d1001e9162c780e64676ce654e79716.jpeg?token=d6db31c5dc236c94fd77161b4de20627)
选择矿池
![](https://pics7.baidu.com/feed/1ad5ad6eddc451dac9b499a56f94456cd11632b5.jpeg?token=8e7cc5986891a0809f6b05464e117322)
添加矿池信息
![](https://pics5.baidu.com/feed/78310a55b319ebc40fcc12965e4fd8f61f1716f8.jpeg?token=62fcdf8a60bf5055afab501c2d59b63e)
根据需求选择,默认只有CPU
![](https://pics3.baidu.com/feed/5bafa40f4bfbfbed100e3ecb9c99e03caec31fa6.jpeg?token=9d27d5ba9b83f2a98df8202ed231ea84)
设置赞助费,默认最低为1%,可按照上面的说明修改脚本,执行后不影响实际挖矿结果依然为自定义结果
![](https://pics2.baidu.com/feed/0823dd54564e92588374e9b17debc652cdbf4ea4.jpeg?token=db0447f780657cf423e93bb3e2212aaf)
配置结果展示,实战中推荐用下面的命令模式进行测试,除非对此文件很熟悉,可下载Config文件并编辑执行
![](https://pics0.baidu.com/feed/e61190ef76c6a7efd4b31cdd2793b85bf2de6623.jpeg?token=d09a52c1d984d272b3401f31d818afcf)
配置hugepages
打开hugepages后算力能提升大概30%左右
core=`nproc --all`sudo bash -c "echo vm.nr_hugepages=$core >> /etc/sysctl.conf"
效果
直接通过命令的方式进行执行【注:需要先执行一遍,再关闭,会在本地生成config.json文件,可自定义配置文件】
./xmrig -o sg.minexmr.com:443 -u 钱包地址 -k --tls --rig-id 小生观察室
因用单核CPU去挖,所以对应的miner不会很多在600左右。
![](https://pics3.baidu.com/feed/aec379310a55b3196216ce84a1c0952ccdfc17c3.jpeg?token=aafb7529b4fe0e6657dc04d48a5b570c)
基于Windows平台
测试环境
WindowsServer2008R2
Intel(R) Xeon(R) CPU E5-2690 v3 @ 2.60GHz 8核
环境部署
https://github.com/xmrig/xmrig/releases
选择xmrig-6.7.2-msvc-win64.zip版本
下载至本地并解压,将xmrig的配置向导中最后一步生成的Windows命令复制并修改start.cmd文件。
配置向导过程与Ubuntu一致,此处忽略重复步骤!!!
自定义赞助费
修改config.json文件中donate-level": 0或在命令行中添加 --donate-level 0
配置hugepages
在本地安全策略下启动锁定内存页并添加账户
![](https://pics1.baidu.com/feed/d50735fae6cd7b89a59bba78d24d55addb330ecd.jpeg?token=9ae7df57787f4677ce9858bc6b53ad97)
最简单的方法:以管理员身份运行一次矿机,然后重新启动手动配置可参考此处 https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/enable-the-lock-pages-in-memory-option-windows?redirectedfrom=MSDN&view=sql-server-ver15
效果
直接通过命令的方式进行执行【注:需要先执行一遍,再关闭,会在本地生成config.json文件,可自定义配置文件】
xmrig.exe -o sg.minexmr.com:443 -u 钱包地址 -k --tls --rig-id 小生观察室
![](https://pics5.baidu.com/feed/902397dda144ad3440a3d66c09cb1bfe30ad85b4.jpeg?token=8af9870687612f1502945aae97d91bcd)
- 免责声明
- 世链财经作为开放的信息发布平台,所有资讯仅代表作者个人观点,与世链财经无关。如文章、图片、音频或视频出现侵权、违规及其他不当言论,请提供相关材料,发送到:2785592653@qq.com。
- 风险提示:本站所提供的资讯不代表任何投资暗示。投资有风险,入市须谨慎。
- 世链粉丝群:提供最新热点新闻,空投糖果、红包等福利,微信:juu3644。