https://www.cnblogs.com/zhang-qc/p/8677417.html
- 安装比特币需要的所有库
1
2
3
|
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 sudo apt-get install libboost-all-dev #这个如果不装,make提示缺少boost的文件 |
- GUI:关于QT的各种库
1
|
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler |
出现了错误,有些包无法下载:
解决方法:参考 https://blog.csdn.net/tiny_lxf/article/details/75027865
1
2
|
sudo vim /etc/resolv.conf 修改 nameserver 8.8.8.8 |
再次运行上面的GUI安装,成功
- git源码
1
|
sudo apt-get install gitgit clone https: //github.com/bitcoin/bitcoin.git |
- 安装Berkeley DB:推荐使用Berkeley DB 4.8
1
2
|
cd bitcoin ./contrib/install_db4.sh `pwd` |
- 配置
1
2
|
./autogen.sh ./configure |
出现报错:原因是找不到berkeleyDB的相关头文件导致的(参考 https://blog.csdn.net/xocoder/article/details/78914576)
报错:libdb_cxx headers missing, Bitcoin Core requires this library for wallet functionality (–disable-wallet to disable wallet functionality)
上面安装db的脚本执行后其实会提示:
When compiling bitcoind, run `./configure` in the following way:
export BDB_PREFIX='/home/zhang/bitcoin/db4'
./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" ...
所以,应当设置bash环境变量BDB_PREFIX为刚才指定的安装目录,并在configure时,提供这个环境变量
解决步骤:
1
2
3
4
5
|
vim ~/.bashrc export BDB_PREFIX= '/home/zhang/bitcoin/db4' source ~/.bashrc . /configure BDB_LIBS= "-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS= "-I${BDB_PREFIX}/include" |
- 编译
1
2
|
make make install |
出现错误:
[install-libLTLIBRARIES] Error 1
[install-recursive] Error 1
解决方法:
1
|
sudo make install |
- 测试
1
2
3
4
|
$ which bitcoind /usr/local/bin/bitcoind $ which bitcoin-cli /usr/local/bin/bitcoin-cli |
1
2
3
|
bitcoind bitcoin-qt bitcoin-cli<br><br>or<br>./src/bitcoind <br>./src/qt/bitcoin-qt <br>./src/bitcoin-cli |
安装过程参考:
https://blog.csdn.net/u011609555/article/details/79660086
https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md
https://blog.csdn.net/aaadssdffff/article/details/52992688