在Ubuntu编译bitcoin源码

在Ubuntu编译bitcoin源码

准备

unubtu 18.06 2核 8G内存  香港节点

安装依赖

apt-get update
sudo apt-get install -y build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3
sudo apt-get install -y libboost-all-dev git
sudo apt-get install -y libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler

//    注意这个包最新的是5.3
sudo apt-get install -y libdb5.3++-dev

开始安装

  • Clone 源代码
git clone https://github.com/bitcoin/bitcoin.git
  • 安装 Berkeley DB
cd bitcoin
./contrib/install_db4.sh `pwd`

//    将DB的环境变量配置到/etc/profile
export BDB_PREFIX='/root/bitcoin/db4'
  • 配置
./autogen.sh
./configure --with-incompatible-bdb
 make && make install
  • 编译完成
----------------------------------------------------------------------
 /bin/mkdir -p '/usr/local/bin'
  /bin/bash ../libtool --preserve-dup-deps  --mode=install /usr/bin/install -c bitcoind bitcoin-cli bitcoin-tx bitcoin-wallet test/test_bitcoin bench/bench_bitcoin qt/bitcoin-qt qt/test/test_bitcoin-qt '/usr/local/bin'
libtool: install: /usr/bin/install -c bitcoind /usr/local/bin/bitcoind
libtool: install: /usr/bin/install -c bitcoin-cli /usr/local/bin/bitcoin-cli
libtool: install: /usr/bin/install -c bitcoin-tx /usr/local/bin/bitcoin-tx
libtool: install: /usr/bin/install -c bitcoin-wallet /usr/local/bin/bitcoin-wallet
libtool: install: /usr/bin/install -c test/test_bitcoin /usr/local/bin/test_bitcoin
libtool: install: /usr/bin/install -c bench/bench_bitcoin /usr/local/bin/bench_bitcoin
libtool: install: /usr/bin/install -c qt/bitcoin-qt /usr/local/bin/bitcoin-qt
libtool: install: /usr/bin/install -c qt/test/test_bitcoin-qt /usr/local/bin/test_bitcoin-qt
 /bin/mkdir -p '/usr/local/include'
 /usr/bin/install -c -m 644 script/bitcoinconsensus.h '/usr/local/include'
make[3]: Leaving directory '/root/bitcoin/src'
make[2]: Leaving directory '/root/bitcoin/src'
make[1]: Leaving directory '/root/bitcoin/src'
Making install in doc/man
make[1]: Entering directory '/root/bitcoin/doc/man'
make[2]: Entering directory '/root/bitcoin/doc/man'
make[2]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/usr/local/share/man/man1'
 /usr/bin/install -c -m 644 bitcoind.1 bitcoin-qt.1 bitcoin-cli.1 bitcoin-tx.1 bitcoin-wallet.1 '/usr/local/share/man/man1'
make[2]: Leaving directory '/root/bitcoin/doc/man'
make[1]: Leaving directory '/root/bitcoin/doc/man'
make[1]: Entering directory '/root/bitcoin'
make[2]: Entering directory '/root/bitcoin'
make[2]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/usr/local/lib/pkgconfig'
 /usr/bin/install -c -m 644 libbitcoinconsensus.pc '/usr/local/lib/pkgconfig'
make[2]: Leaving directory '/root/bitcoin'
make[1]: Leaving directory '/root/bitcoin'
root@iZj6c47i94k3xwfh4xzee9Z:~/bitcoin#  

Install_Success


  Reprint please specify: KYLE LIU 在Ubuntu编译bitcoin源码

  TOC