1.下载软件:

cpuminer:

http://sourceforge.net/projects/cpuminer/files/

找到对应的版本,我的服务器是centos64的,找了个当前最高版本:http://sourceforge.net/projects/cpuminer/files/pooler-cpuminer-2.3.2-linux-x86_64.tar.gz/download

mining_proxy:

项目主页:https://github.com/slush0/stratum-mining-proxy

按照readme里介绍的,访问:https://github.com/slush0/stratum-mining-proxy/tarball/master  下载最新版。

我下载到的版本是:slush0-stratum-mining-proxy-d0f1f9e.tar.gz

2.系统环境安装:

安装bz2::

yum install bzip2-devel

安装openssl:

 yum install openssl

 yum install openssl-devel

升级Python到2.7.3:

下载Python2.7.3并编译:

http://python.org/ftp/python/2.7.3/Python-2.7.3.tgz

把2.7.3下载下来解压缩:

tar -xzvf Python-2.7..tgz

cd Python-2.7.

cd Modules/

vim Setup.dist 

找到ssl(大概495行左右),取消以下部分的注释:

SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto

找到zlib(大概463行左右),取消下面部分的注释:

zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz

保存文件并退出。

回到Python根目录:

cd ~/Python-2.7.

编译并安装python2.7.3:

./configure
make all
make install
make clean
make distclean

建立软连接,使系统默认的python指向python2.7
正常情况下即使python2.7安装成功后,系统默认指向的python仍然是2.6.6版本,考虑到yum是基于python2.6.6才能正常工作,不敢轻易卸载。

如何实现将系统默认的python指向到2.7版本呢?

mv /usr/bin/python /usr/bin/python2.6.6
ln -s /usr/local/bin/python2. /usr/bin/python

检验python指向是否成功:

python -V

解决系统python软链接指向python2.7版本后,yum不能正常工作:

vi /usr/bin/yum

将文件头部的
#!/usr/bin/python
改成
#!/usr/bin/python2.6.6

安装easy_install和pip(不是必须,如果说缺少argparse,可以在安装好下列软件后使用命令:easy_install argparse来安装argparse):

curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | python -
curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python -

整个升级过程完成,可以使用Python2.7.3版本了。

3.安装cpuminer+mining_proxy :

tar -xzvf pooler-cpuminer-2.3.-linux-x86_64.tar.gz
tar -xzvf slush0-stratum-mining-proxy-d0f1f9e.tar.gz
mv slush0-stratum-mining-proxy-d0f1f9e minerd_all
mv minerd minerd_all/
cd minerd_all/
python setup.py install

4.编写sh脚本,启动mining_proxy和cpuminer:

vim run.sh

将下列内容放入run.sh中保存并退出:

#!/bin/sh
# 第一次写脚本,比较烂,能运行就中
echo "starting proxy..."
date >> proxy.log
#把此处的矿池地址和端口号换成你自己的
nohup ./mining_proxy.py -o stratum.f2pool.com -p &>proxy.log &
echo "starting minerd..."
date >> minerd.log
#把此处的矿工用户名和密码换成你自己的
nohup ./minerd -o http://127.0.0.1:8332 -O sixiweb.4:1234 &>minerd.log &

将run.sh改为可执行文件:

chmod  run.sh 

运行挖矿脚本:

./run.sh

查看挖矿软件工作是否正常:

tail -100f proxy.log
tail -100f minerd.log

如果在proxy.log中出现下列内容则表示proxy工作正常:

2013-12-02 18:49:33,203 WARNING proxy mining_proxy.main # Stratum proxy version: 1.5.2
2013-12-02 18:49:33,206 WARNING proxy mining_proxy.test_update # Checking for updates...
2013-12-02 18:49:33,838 WARNING proxy mining_proxy.main # Trying to connect to Stratum pool at stratum.f2pool.com:8888
2013-12-02 18:49:33,908 INFO stats stats.print_stats # 1 peers connected, state changed 1 times
2013-12-02 18:49:33,908 INFO proxy mining_proxy.on_connect # Connected to Stratum pool at stratum.f2pool.com:8888
2013-12-02 18:49:33,909 INFO proxy mining_proxy.on_connect # Subscribing for mining jobs
2013-12-02 18:49:34,081 WARNING proxy mining_proxy.main # -----------------------------------------------------------------------
2013-12-02 18:49:34,081 WARNING proxy mining_proxy.main # PROXY IS LISTENING ON ALL IPs ON PORT 3333 (stratum) AND 8332 (getwork)
2013-12-02 18:49:34,081 WARNING proxy mining_proxy.main # -----------------------------------------------------------------------
2013-12-02 18:50:03,467 WARNING proxy getwork_listener._on_authorized # Getworkmaker is waiting for a job...

如果在minerd.log中出现如下日志,则说明工作正常:

[2013-12-02 18:49:32] Binding thread 1 to cpu 1
[2013-12-02 18:49:32] Binding thread 2 to cpu 2
[2013-12-02 18:49:32] Binding thread 3 to cpu 3
[2013-12-02 18:49:32] Binding thread 4 to cpu 4
[2013-12-02 18:49:32] Binding thread 5 to cpu 5
[2013-12-02 18:49:32] Binding thread 6 to cpu 6
[2013-12-02 18:49:32] Binding thread 7 to cpu 7
[2013-12-02 18:49:32] Binding thread 0 to cpu 0
[2013-12-02 18:49:32] 8 miner threads started, using 'scrypt' algorithm.
[2013-12-02 18:49:32] HTTP request failed: Failed connect to 127.0.0.1:8332; Connection refused
[2013-12-02 18:49:32] json_rpc_call failed, retry after 30 seconds
[2013-12-02 18:50:03] Starting Stratum on stratum+tcp://127.0.0.1:3333
[2013-12-02 18:50:03] JSON-RPC call failed: {
"message": "Getworkmake is waiting for a job...",
"code": -1
}
[2013-12-02 18:50:06] thread 2: 4104 hashes, 5.25 khash/s
[2013-12-02 18:50:06] thread 0: 4104 hashes, 4.98 khash/s
[2013-12-02 18:50:47] thread 7: 4104 hashes, 0.10 khash/s
[2013-12-02 18:50:47] thread 6: 4104 hashes, 0.10 khash/s
[2013-12-02 18:50:47] thread 5: 4104 hashes, 0.10 khash/s
[2013-12-02 18:50:47] thread 3: 4104 hashes, 0.10 khash/s
[2013-12-02 18:50:48] thread 1: 4104 hashes, 0.10 khash/s
[2013-12-02 18:50:48] thread 4: 4104 hashes, 0.10 khash/s
[2013-12-02 18:51:01] thread 2: 314760 hashes, 5.67 khash/s
[2013-12-02 18:51:02] thread 0: 299040 hashes, 5.36 khash/s
[2013-12-02 18:51:36] thread 5: 5832 hashes, 0.12 khash/s
[2013-12-02 18:51:37] thread 3: 5820 hashes, 0.12 khash/s
[2013-12-02 18:51:38] thread 5: 7116 hashes, 5.65 khash/s
[2013-12-02 18:51:38] thread 3: 7104 hashes, 5.60 khash/s
[2013-12-02 18:51:45] thread 4: 5772 hashes, 0.10 khash/s
[2013-12-02 18:51:46] thread 7: 5940 hashes, 0.10 khash/s
[2013-12-02 18:51:48] thread 1: 5784 hashes, 0.10 khash/s
[2013-12-02 18:51:49] thread 6: 5928 hashes, 0.10 khash/s
[2013-12-02 18:52:31] thread 5: 298248 hashes, 5.64 khash/s
[2013-12-02 18:52:31] accepted: 1/1 (100.00%), 22.66 khash/s (yay!!!)

centos 6.3 64位下cpuminer +mining_proxy 挖掘莱特币(LTC)教程的更多相关文章

  1. CentOS 6.5 64位下安装Redis3.0.2的具体流程

    系统环境:CentOS 6.5 64位 安装方式:编译安装 防火墙:开启 Redis版本:Redis 3.0.2 一.环境准备 1.安装 gcc gcc-c++ [root@iZ94ebgv853Z ...

  2. CentOS 6.3 64位下MySQL5.1.54源码安装配置详解

    安装环境:CentOS 6.3 64位 一:先安装依赖包(不然配置的时候会报错的!) yum -y install ncurses* libtermcap* 新建mysql用户 [root@clien ...

  3. CentOS6.x 64位下mysql5.5.25安装图解教程

    查看当前安装的linux版本 命令:lsb_release -a 如下图所示 通过上图中的数据可以看出安装的版本为CentOS release 6.3,所以我们需要下载CentOS release 6 ...

  4. CentOS 6.5 64位下安装MySQL 5.7.11

    昨天花了一下午在CentOS6.5 上安装了MySQL,版本为5.7.11,下面介绍一下我安装时候出现的问题 以及解决方法,供大家参考. 1/清除残留 rpm -qa | grep mysql // ...

  5. centos 64位 下hadoop-2.7.2 下编译

    centos 64位 下hadoop-2.7.2 下编译 由于机器安装的是centos 6.7 64位 系统  从hadoop中下载是32位  hadoop 依赖的的库是libhadoop.so 是3 ...

  6. linux CentOs 7.4 64位 系统下 nuxt部署 、nginx 安装、node环境及软连接,pm2软连接

    一.nginx安装 1.安装依赖包 //一键安装上面四个依赖 yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel 2 ...

  7. 64位下pwntools中dynELF函数的使用

    这几天有同学问我在64位下怎么用这个函数,于是针对同一道题写了个利用dynELF的方法 编译好的程序 http://pan.baidu.com/s/1jImF95O 源码在后面 from pwn im ...

  8. win7(64)位下WinDbg64调试VMware10下的win7(32位)

    win7(64)位下WinDbg64调试VMware10下的win7(32位) 一 Windbg32位还是64位的选择 参考文档<Windbg 32位版本和64位版本的选择> http:/ ...

  9. Ubuntu 14.04 AMD 64位 下 Android Studio 的安装

    Ubuntu 14.04 AMD 64位 下 Android Studio 的安装 作者:yoyoyosiyu 邮箱:yoyoyosiyu@163.com 时间:2015年8月25日 Android ...

随机推荐

  1. Go语言中使用MySql数据库

    Go语言中使用MySql数据库 1.MySQL驱动 Go中支持MySQL的驱动目前比较多,有如下几种,有些是支持database/sql标准,而有些是采用了自己的实现接口,常用的有如下几种: http ...

  2. 关于inode&硬连接

    这两天看了一道面试题,什么是inode?我勒个去,第一次听说.于是Google了一下,发现下面这段内容讲解的非常不错,供大家参考. 一.inode是什么? 理解inode,要从文件储存说起.文件储存在 ...

  3. 安装MySQL-python报错:_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory或者 build\lib.win-amd64-2.7\_mysql.pyd : fatal error LNK1120: 56 unresolved externa

    解决办法1: 直接下载MySQL-python-1.2.5.win-amd64/32-py2.7.exe,点击安装 此处要注意自己安装的Python和MySQL版本是64位还是32位,否则在进行安装M ...

  4. 阿里历年经典Java面试题汇总,想进BAT你还不快收藏!

    转载:https://mp.weixin.qq.com/s/M8YyxloxZnMACH9QCQN7HA Volatile的特征: A.禁止指令重排(有例外) B.可见性 Volatile的内存语义: ...

  5. 找出以“b”开头的名字

    找出以“b”开头的名字:select * from pet where name like 'b%' “_”:匹配任何单个字符“%”:匹配任意数目字符(包括零字符)

  6. Mybatis-Dao层开发之Mapper接口

    Mapper接口开发方法只需要程序员编写Mapper接口(相当于Dao接口),由Mybatis框架根据接口定义创建接口的动态代理对象,代理对象的方法体同上边Dao接口实现类方法. Mapper接口开发 ...

  7. P2093 零件分组【贪心算法练习题】

    题目链接: http://codevs.cn/problem/4888/ https://www.luogu.org/problem/show?pid=2093 题目描述 某工厂生产一批棍状零件,每个 ...

  8. 在瀚海上的ID

    为了远去的记忆

  9. glog的使用

    主要还是看官方文档吧 win32下,把#define GLOG_NO_ABBREVIATED_SEVERITIES 放到#include <windows.h>之前,具体说明文档中有说. ...

  10. Mysql分页之limit用法与limit优化

    Mysql limit分页语句用法 与Oracle和MS SqlServer相比,mysql的分页方法简单的让人想哭. --语法: SELECT * FROM table LIMIT [offset, ...