Linux 挖数字货币(挖XMR)

感觉挖BTC、ETH都有很高的硬件门坎,最近挖门罗币的病毒很多,看来挖XMR没多大的硬件要求,于是尝试之

1、硬件最好用英伟达的GPU

2、软件XMR-STAK地址:https://github.com/fireice-uk/xmr-stak

3、使用Ubuntu18.04平台

安装nvidia驱动,安装cuda地址https://developer.nvidia.com/cuda-downloads

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget http://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-10-1-local-10.1.243-418.87.00/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda

测试一下cuda是否正确,运行deviceQuery后看到结果“Result = PASS” 就表明cuda没问题了

cd /usr/local/cuda/samples/1_Utilities/deviceQuery && sudo make  
/usr/local/cuda/samples/1_Utilities/deviceQuery/deviceQuery

然后下载项目xmr-stak

sudo apt install libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev  
git clone https://github.com/fireice-uk/xmr-stak.git  
mkdir xmr-stak/build  
cd xmr-stak/build  
cmake .. -DOpenCL_ENABLE=OFF # Added the flag, otherwise I'd have to install OpenCL  
make install  

运行xmr-stak

配置:/usr/local/xmr-stak/build/bin# nano pools.txt

"pool_list" :
[
        {"pool_address" : "pool.supportxmr.com:7777", "wallet_address" : "45kjSvkt5W5UrGP9hxmXPg7JfVNyYFeAHgM1MwmggfgqXdUiwSMJkQd5ChXfSiwYKyB4CLaJQcRk64o39rbQqvt9P4JjY54", "rig_id" : "", "pool_password" : "bozhi1", "use_nicehash" : false, "use_tls" : false, "tls_fingerprint" : "", "pool_weight" : 1 },
],

矿池pool.supportxmr.com

 3333 Low-end CPU
5555 Fast/Multi CPU
7777 GPU rigs
9000 SSL/TLS

If you can't get through firewall, try these:

- 8080 Firewall bypass
- 80 Firewall bypass
- 443 Firewall bypass w/SSL/TLS

如果出现MEMORY ALLOC FAILED:mmap failed

先执行sudo sysctl -w vm.nr_hugepages=128 然后编辑/etc/security/limits.conf文件,在文件最下面增加两行内容:

* soft memlock 262144

* hard memlock 262144

机器重启后,需要重新运行一下sudo sysctl -w vm.nr_hugepages=128 再开始挖矿

在挖矿界面,输入h看查看挖矿的hashrate(算力)。
输入r可以查看results(挖矿结果)。
输入c可以查看和矿池的连接情况。

查看矿池算力分配挖矿结果https://supportxmr.com/#/dashboard

你可能感兴趣的:(Linux 挖数字货币(挖XMR))