-
Notifications
You must be signed in to change notification settings - Fork 411
Build BTCPool on CentOS 7 | 在CentOS7上构建BTCPool
Andrew yz edited this page Oct 22, 2019
·
3 revisions
通过以下方法可在 CentOS 7 (x86_64) 中构建 BTCPool:
添加EPEL
和Remi
软件源:
rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh https://rpms.remirepo.net/enterprise/remi-release-7.rpm
安装GCC7:
sudo yum install centos-release-scl
sudo yum install devtoolset-7-gcc*
scl enable devtoolset-7 bash
which gcc
gcc --version
然后安装依赖(部分):
yum install git cmake3 make which autoconf automake libtool boost169*-devel openssl-devel libconfig-devel zml-devel czmq-devel libcurl-devel protobuf-devel mysql-devel hiredis-devel
修复boost找不到
ln -s /usr/include/boost169/boost /usr/include/
ls /usr/lib64/libboost*.so.1.69.0 | awk -F'.' '{print $1}' | while read line; do ln -s $line.so.1.69.0 $line.so; done
构建libevent(不要使用软件源中的版本,低于2.1.9的有死锁bug):
wget https://github.com/libevent/libevent/releases/download/release-2.1.9-beta/libevent-2.1.9-beta.tar.gz
tar zxf libevent-2.1.9-beta.tar.gz
cd libevent-2.1.9-beta
./autogen.sh && ./configure --prefix=/usr --libdir=/usr/lib64
make -j$(nproc) && make install
构建librdkafka(软件源里的版本不适合)
wget https://github.com/edenhill/librdkafka/archive/0.9.1.tar.gz
tar zxvf 0.9.1.tar.gz
cd librdkafka-0.9.1
./configure && make -j$(nproc) && make install
构建libzookeeper-mt
yum install ant cppunit-devel
wget https://github.com/apache/zookeeper/archive/release-3.4.8.tar.gz
tar xf release-3.4.8.tar.gz
cd zookeeper-release-3.4.8
ant compile_jute
cd src/c
autoreconf -if
./configure && make -j$(nproc) && make install
构建glog(软件源里的版本不适合)
wget https://github.com/google/glog/archive/v0.3.4.tar.gz
tar zxvf v0.3.4.tar.gz
cd glog-0.3.4
./configure && make -j$(nproc) && make install
构建libconfig++(软件源里的版本过低)
yum install texinfo
wget https://github.com/hyperrealm/libconfig/archive/v1.7.2.tar.gz
tar xf v1.7.2.tar.gz
cd libconfig-1.7.2/
autoreconf -if
./configure && make -j$(nproc) && make install
构建bitcoin-core
wget -O bitcoin-0.16.0.tar.gz https://github.com/bitcoin/bitcoin/archive/v0.16.0.tar.gz
tar zxf bitcoin-0.16.0.tar.gz
cd bitcoin-0.16.0
./autogen.sh && ./configure --with-gui=no --disable-wallet --disable-tests --disable-bench
make -j$(nproc)
构建btcpool
git clone https://github.com/btccom/btcpool.git
cd btcpool
mkdir build
cd build
cmake3 -DCHAIN_TYPE=BTC -DCHAIN_SRC_ROOT=/root/bitcoin-0.16.0 -DJOBS=$(nproc) ..
make -j$(nproc)
./unittest