设为首页 收藏本站

运维网

查看: 5262|回复: 0

[经验分享] Linux系统BTC挖矿傻瓜教程

[复制链接]

尚未签到

发表于 2015-3-29 18:06:08 | 显示全部楼层 |阅读模式
  【Linux系统BTC/比特币矿池挖矿方案一】cgminer矿池挖矿程序(Linux系统 比特币(BTC) 矿池挖矿/采矿/造币)
cgminer矿池挖矿程序
【查看这里有没有最新版】http://ck.kolivas.org/apps/cgminer/
https://github.com/ckolivas/cgminer
apt-get install bzip2
apt-get install libcurl3 libcurl3-dev
#The following NEW packages will be installed:
#  comerr-dev krb5-multidev libcurl3 libcurl4-openssl-dev libidn11-dev libkrb5-dev libldap2-dev
#  libssh2-1 libssh2-1-dev libssl-dev pkg-config zlib1g-dev
apt-get install libncurses5-dev
# 【忽略,需要安装显卡驱动,具有opencl功能】apt-get install opencl
ldconfig
cd /tmp
wget http://ck.kolivas.org/apps/cgminer/cgminer-2.8.4.tar.bz2
tar jxvf cgminer-2.8.4.tar.bz2
cd cgminer-2.8.4
./configure --prefix=/usr/local/cgminer --enable-opencl --enable-maintainer-mode --enable-scrypt --enable-cpumining
# --enable-cpumining这个参数是允许使用CPU进行挖矿,在没有GPU的情况下使用,如果有了GPU,不建议使用
make
make check
make install
ln -s /usr/local/cgminer/bin/cgminer /usr/bin
# 动态链接
[忽略mkdir /usr/local/cgminer/etc
[忽略]cp example.conf /usr/local/cgminer/etc/cgminer.conf
  
配置文件:/usr/local/cgminer/etc/cgminer.conf
配置说明:http://ck.kolivas.org/apps/cgminer/README
[忽略]编辑配置文件:
nano /usr/local/cgminer/etc/cgminer.conf
  
cgminer挖矿指令:
cgminer
# 或者:
cgminer -o http://deepbit.net:8332 -u zhanghao123_0 -p mima123456
  
注意,这里的帐号密码是矿工帐号和密码
输出:
  cgminer version 2.8.4 - Started: [2012-10-04 03:38:50] CPU Algo: c
--------------------------------------------------------------------------------
(5s):664.3 (avg):647.7 Kh/s | Q:7  A:0  R:0  HW:0  E:0%  U:0.0/m
TQ: 0  ST: 2  SS: 0  DW: 0  NB: 1  LW: 0  GF: 0  RF: 0  WU: 0.0
Connected to http://deepbit.net:8332 with LP as user zhanghao123_0
Block: 00000003e78a45bc9db17b5654bbe400...  Started: [03:38:50]
--------------------------------------------------------------------------------
[P]ool management [S]ettings [D]isplay options [Q]uit
CPU 0:                | 647.0/647.7Kh/s | A:0 R:0 HW:0 U:0.00/m
--------------------------------------------------------------------------------
[2012-10-04 03:37:09] Started cgminer 2.7.6
[2012-10-04 03:37:09] Need to specify at least one pool server.
Input server details.
URL:
http://deepbit.net:8332
Username:
zhanghao123_0
Password:
mima123456
[2012-10-04 03:38:48] Probing for an alive pool
[2012-10-04 03:38:50] Pool 0 http://deepbit.net:8332 alive
[2012-10-04 03:38:50] Long-polling activated for http://deepbit.net:8332/listenChannel
  
【挖矿成功开始】截图:



系统开机自动挖矿:
nano /etc/init.d/wakuang
内容:
#!/bin/sh
cgminer -o http://deepbit.net:8332 -u zhanghao123_0 -p mima123456
  
chmod +x /etc/init.d/wakuang
reboot
——————————————————————————————————
————————————————————————————————————
【Linux系统BTC/比特币矿池挖矿方案二】PyOpenCL bitcoin miner 矿池挖矿程序(Linux系统 比特币(BTC) 矿池挖矿/采矿/造币)

安装Python2.7 前奏
安装unzip
apt-get install unzip
  
安装zlib:
http://www.zlib.net/
http://sourceforge.net/projects/libpng/files/zlib/
cd /tmp
wget http://nchc.dl.sourceforge.net/p ... b/1.2.7/zlib127.zip
unzip zlib127.zip
# 已经有zlib的不继续安装
cd zlib-1.2.7
./configure --prefix=/usr/local/zlib --enable-shared
make -j 3
make -j 3 test
make install
  
安装zlibc、zlib1g-dev:
apt-get install zlibc zlib1g-dev
  
下载源码编译安装python2.7.3:
cd /tmp
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar zxvf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr/local/python2.7 --enable-unicode=ucs4 --enable-shared
make -j 3
make -j 3 test
make install
  
备份原来的python动态链接文件,建立新的:
mv /usr/bin/python /usr/bin/python.bak
ln -s /usr/local/python2.7/bin/python /usr/bin/python
ln -s /usr/local/python2.7/bin/python2.7 /usr/bin/python2.7
chmod +x /usr/local/lib/libpython2.7.so
chmod +x /usr/local/lib/libpython2.7.so.1.0
cp /usr/local/python2.7/lib/libpython2.7.so.1.0 /usr/local/lib
cd /usr/local/lib
ln -s libpython2.7.so.1.0 libpython2.7.so
ldconfig
  
安装setuptools for python,包含easy_install
http://pypi.python.org/pypi/setuptools/
http://pypi.python.org/packages/2.7/s/setuptools/
cd /tmp
wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
  
运行python,输入import setuptools和import easy_install分别验证一下有没有错误

安装JSON-RPC for python
http://json-rpc.org/wiki/python-json-rpc
http://code.google.com/p/jsonrpclib/
https://github.com/bmjames/python-jsonrpc
https://github.com/joshmarshall/jsonrpclib/downloads
http://pypi.python.org/pypi/z3c.jsonrpc
http://pypi.python.org/pypi/jsonrpclib/0.1.3
http://pypi.python.org/pypi/jsonrpc/1.2
cd /tmp
wget http://pypi.python.org/packages/ ... rpclib-0.1.3.tar.gz
tar zxvf jsonrpclib-0.1.3.tar.gz
cd jsonrpclib-0.1.3
python setup.py build
python setup.py install
  
安装MarkupSafe
http://pypi.python.org/pypi/MarkupSafe
http://pypi.python.org/pypi/MarkupSafe/0.9.2
cd /tmp
wget http://pypi.python.org/packages/ ... kupSafe-0.15.tar.gz
tar zxvf MarkupSafe-0.15.tar.gz
cd MarkupSafe-0.15
python setup.py build
python setup.py install
  
安装Mako
http://www.makotemplates.org/
http://www.makotemplates.org/download.html
cd /tmp
wget http://www.makotemplates.org/downloads/Mako-0.7.2.tar.gz
tar zxvf Mako-0.7.2.tar.gz
cd Mako-0.7.2
python setup.py build
python setup.py install
  
apt-get install libevent-dev
【不安装】apt-get install python-dev
安装pyopencl
http://pypi.python.org/packages/source/p/pyopencl/
http://pypi.python.org/pypi/pyopencl/2012.1
http://pypi.python.org/pypi/pyopencl/
http://pypi.python.org/packages/source/d/distribute/
cd /tmp
wget http://pypi.python.org/packages/ ... ibute-0.6.28.tar.gz
tar zxvf distribute-0.6.28.tar.gz
cd distribute-0.6.28
python setup.py build
python setup.py install

cd /tmp
wget http://pypi.python.org/packages/ ... pencl-2012.1.tar.gz
tar zxvf pyopencl-2012.1.tar.gz
cd pyopencl-2012.1
python setup.py build
python setup.py install
  
安装NumPy
http://numpy.scipy.org/
http://docs.scipy.org/doc/
http://www.scipy.org/Download
http://sourceforge.net/projects/numpy/files/
http://sourceforge.net/projects/numpy/files/NumPy/
cd /tmp
wget http://downloads.sourceforge.net ... umpy-1.7.0b2.tar.gz
tar zxvf numpy-1.7.0b2.tar.gz
cd numpy-1.7.0b2
python setup.py build
python setup.py install
  
使用Poclbm (PyOpenCL bitcoin miner)
https://github.com/m0mchil/poclbm
https://github.com/m0mchil/poclbm/downloads
https://en.bitcoin.it/wiki/Poclbm
cd ~
wget https://github.com/m0mchil/poclbm/tarball/master
tar zxvf master
cd m0mchil-poclbm-3753e48
  
Poclbm矿池挖矿指令:
./poclbm.py  –host=deepbit.net -p 8332 –user=zhanghao123_0 –pass=mima123456 -d
或者:
./poclbm.py -o deepbit.net -p 8332 -u zhanghao123_0 -pass=mima123456 -d -r
或者:
python poclbm.py -o deepbit.net -p 8332 -u zhanghao123_0 -pass=mima123456 -d -r
  
系统开机自动挖矿:
nano /etc/init.d/pywakuang
内容:
#!/bin/sh
python /root/poclbm.py -o deepbit.net -p 8332 -u zhanghao123_0 -pass=mima123456 -d -r
  
chmod +x /etc/init.d/pywakuang
reboot
————————————————————————————————————————
其它挖矿程序:
phoenix miner (GPU挖矿):https://github.com/phoenix2/phoenix
https://github.com/phoenix2/phoenix/tarball/master
http://jedi95.com/files/opencl.py
http://forre.st/pycl/pycl.py

Diablo's miner (GPU挖矿):https://github.com/Diablo-D3/DiabloMiner
https://bitcointalk.org/index.php?topic=1721.0
puddinpop's rpc miner (GPU/CUDA挖矿):https://bitcointalk.org/?topic=2444.0
修改版:https://github.com/Ang3lus/rpcminer-mod
Ufasoft's miner (CPU/GPU挖矿):http://ufasoft.com/open/bitcoin/
Linux/Windows源码:http://ufasoft.com/files/ufasoft_coin-0.33.tar.xz

运维网声明 1、欢迎大家加入本站运维交流群:群①:263444886群②:197202523群③:485755530群④:201730672群⑤:202807635运维网交流群⑥:281548029
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@yunvn.com 网址:www.iyunv.com

点击关注更多内容
您需要登录后才可以回帖 登录 | 立即注册  

本版积分规则  允许回帖邮件提醒楼主

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服 E-mail:kefu@yunvn.com

本站由青云提供云计算服务

运维网--中国最专业的运维工程师交流社区

京ICP备14039699号-1 Copyright © 2012-2020

使用手机软件扫描微信二维码

关注我们可获取更多热点资讯

Good good study day day up !


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!


独家合作伙伴: 青云cloud

快速回复 返回顶部 返回列表