本文参考:https://moeclub.org/2018/01/27/553/?v=480和https://zhujiwakuang.com/wakuangjiaocheng/67/
使用XMRig-Proxy是可以减少对矿池的负载,如果算力太低的情况下而已机器很多的,都建议使用代理做中转,减少对矿池的服务器负荷还有网络负载。所有CryptoNight/CryptoNight-Light矿池都支持使用XMRig-Proxy。XMRig-Proxy除了刚才说的作用之外,另外一个就是可以FQ去国外矿池挖矿,通过代理加速到矿池。
参考数值:
机器:VPS或者独立服务器
系统:Ubuntu 16.04+ / Windows
官方下载地址:https://github.com/xmrig/xmrig-proxy
注意区
- XMRig-Proxy代理不一定只能做XMR的代理,所有CryptoNight/CryptoNight-Light的货币都可以用它做代理,如果想知道CryptoNight/CryptoNight-Light货币有哪些虚拟币可以参考:https://www.cryptocompare.com/coins/#/btc?f0=CryptoNight
- 1月4号出现的CPU漏洞Windows&Linux系统开发商也开始准备发布补丁修补这个问题,会不会影响到算力这个还是未知之数,请大家密切留意。
安装教程:
Ubuntu 16.04+
#更新系统 sudo apt-get --assume-yes update sudo apt-get --assume-yes upgrade #安装需要插件 sudo apt-get --assume-yes install git build-essential cmake libuv1-dev uuid-dev libmicrohttpd-dev screen htop #查看自己主机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 #下载&安装最新版XMRig-Proxy git clone https://github.com/xmrig/xmrig-proxy.git cd xmrig-proxy #去除捐赠 cd src sed -i '/^constexpr const int kDefaultDonateLevel/d' donate.h sed -i '43a\constexpr const int kDefaultDonateLevel = 0;' donate.h cd ../ mkdir build cd build #如果不想安装HTTP Server还有API请在cmake..后加上-DWITH_HTTPD=OFF # cmake.. -DWITH_HTTPD=OFF cmake .. make
提取编译好的文件:
将编好的文件和配置文件放置/etc/xmrig-proxy目录中
mkdir -p /etc/xmrig-proxy cp -rf ./xmrig-proxy /etc/xmrig-proxy/ cp -rf ../src/config.json /etc/xmrig-proxy/ chmod -R 755 /etc/xmrig-proxy cd /etc/xmrig-proxy
config.json设置
可以在/etc/xmrig-proxy文件夹里面开个新文档叫config.json,然后把下面的拷进去
{ "access-log-file": null, "algo": "cryptonight", "api": { "port": 8888, "access-token": null, "worker-id": null, "ipv6": true, "restricted": true }, "background": false, "bind": [ "0.0.0.0:8050", "[::]:8050" ], "colors": true, "custom-diff": 1000, "donate-level": 0, "log-file": null, "mode": "nicehash", "pools": [ { "url": "pool.monero.hashvault.pro:80", "user": "4BJ6Hd5RBwPJx2jSETfejXjoEsnNN1AHGABhZ7FXeG5qK9NSVHBcSBQKAwfTFxqfa3AWLyiVuBTegGcuc9K8BpV4VkJQdgM", "pass": "x", "rig-id": null, "keepalive": true, "variant": 1 } ], "retries": 15, "retry-pause": 5, "reuse-timeout": 0, "user-agent": null, "verbose": false, "watch": true, "workers": true }
XMR-Stak矿工设置
#架设代理地址端口 "pool_address" : "你的代理地址:端口", #设置机器名字 "wallet_address" : "当前矿工名字", #这个设成x就好了,不用管的 "pool_password" : "x" #必须要设置nicehash为true "use_nicehash" : true,
运行初始化命令,优化系统性能
bash /etc/xmrig-proxy/xmrigd init
运行或重启命令:
bash /etc/xmrig-proxy/xmrigd start
查看代理运行情况:
screen -r proxy