Linux系统BTC挖矿傻瓜教程

【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



【挖矿成功开始】截图:

 

Linux系统BTC挖矿傻瓜教程


系统开机自动挖矿:
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

本文转自博客园知识天地的博客,原文链接:Linux系统BTC挖矿傻瓜教程,如需转载请自行联系原博主。


上一篇:[MySQL FAQ]系列 — 怎么计算打开文件数


下一篇:选择一个运行Derby工具和启动辅助程序的方法