欢迎光临
嗟嗟嗟~じぇじぇじぇ!~(''jjj'')/

XMRig-Proxy 矿工代理

本文参考: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


注意区

  1. XMRig-Proxy代理不一定只能做XMR的代理,所有CryptoNight/CryptoNight-Light的货币都可以用它做代理,如果想知道CryptoNight/CryptoNight-Light货币有哪些虚拟币可以参考:https://www.cryptocompare.com/coins/#/btc?f0=CryptoNight
  2. 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,
添加自启动:
放置/etc/xmrig-proxy目录中,并命名为xmrigd

#!/bin/bash
### BEGIN INIT INFO
# Provides:          xmrig-proxy
# Required-Start:    $all
# Required-Stop:     
# Should-Start:
# Should-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: xmrig-proxy.
# Description:       xmrig-proxy daemon.
### END INIT INFO
 
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 
DAEMON='/etc/xmrig-proxy/xmrig-proxy'
CONFIG='/etc/xmrig-proxy/config.json'
StartFile='/etc/xmrig-proxy/xmrigd'
 
test -x $DAEMON || exit 0
[ -f $CONFIG ] || exit 0
[ -f $StartFile ] || exit 0
 
stop_daemon(){
  kill -9 $(ps -C "$(basename $DAEMON)" -o pid=) >/dev/null 2>&1
}
 
case "$1" in
  start)
    LIMIT='1048576'
    ulimit -n $LIMIT
    stop_daemon;
    screen -Sdm proxy $DAEMON -c $CONFIG
    ;;
  stop)
    stop_daemon;
    ;;
  init)
    chmod 755 $StartFile
    ln -sf $StartFile /etc/init.d/xmrigd
    if [[ -f /etc/security/limits.conf ]]; then
      sed -i '/^\(\*\|root\).*\(hard\|soft\).*nofile/d' /etc/security/limits.conf
      echo -ne "*\thard\tnofile\t$LIMIT\n*\tsoft\tnofile\t$LIMIT\nroot\thard\tnofile\t$LIMIT\nroot\tsoft\tnofile\t$LIMIT\n" >>/etc/security/limits.conf
    fi
    if [[ -f /etc/sysctl.conf ]]; then
      sed -i '/^fs.file-max.*/d' /etc/sysctl.conf
      sed -i '/^vm.nr_hugepages.*/d' /etc/sysctl.conf
      echo -ne '\nvm.nr_hugepages=128\n' >>/etc/sysctl.conf
      echo -ne '\nfs.file-max=1048576\n' >>/etc/sysctl.conf
    fi
    update-rc.d -f $(basename $StartFile) remove
    update-rc.d -f $(basename $StartFile) defaults
    sysctl -p >/dev/null
    ;;
  *)
    echo "Usage: bash /etc/xmrig-proxy/xmrigd {start|stop|init}" >&2
    exit 1
    ;;
esac
 
exit 0

运行初始化命令,优化系统性能
bash /etc/xmrig-proxy/xmrigd init

运行或重启命令:
bash /etc/xmrig-proxy/xmrigd start

查看代理运行情况:
screen -r proxy


 

赞(6)
未经允许不得转载:嗟嗟嗟 » XMRig-Proxy 矿工代理
分享到: 更多 (0)

评论 抢沙发

1 + 1 =
  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址