美文网首页
比特币编译记录

比特币编译记录

作者: 姝婧_5ed7 | 来源:发表于2017-10-21 23:56 被阅读0次

1.安装虚拟机和 Linux

最开始在阿里云下载  找到Ubuntu:ubuntu-16.04.3-desktop-amd64.iso--->64 bit

下载安装 Oracle VM VirtualBox

但是VirtralBox,Linux 没有64bit 的选项,后来改用VM

在vmware 上安装ubuntu 14.04 :下载和安装参照

根据前辈反映,虚拟机内存要>2G, 硬盘要大于>20G,否则运行会有各种问题,

最终做虚拟机配置如下:

2.比特币源码编译和环境搭建参考

按照以上Link参考文件的说明,分别做以下步骤

Preparation 

Download bitcoin source code

Compile Bitcoin with Berkley DB 4.8

3.Error 记录和解决

依照上述参考指令 输入执行的时有报错,报错内容和解决方式记录如下:

a.Preparation 时

sudo apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev

解决:

更换源:sudo gedit /etc/apt/sources.list

替换为阿里源后,上述Error就不见了


sudo apt-get install libqt5gui5 libqt5core5 libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler

解决:

error提示libqt5core5a未安装, 执行:

sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler

就可以 Pass 了


b.Download bitcoin source code 时

git clonehttps://github.com/bitcoin/bitcoin.git

提示Git未安装

解决:

sudo apt-get install git 

再执行上述指令,就不报错了


执行make install 时报error:

解决:

改为 sudo make install执行 ,可以Pass:

说明: sudo 表示是管理员启动,因为要安装程序,所以使用sudo make install


c.Compile Bitcoin with Berkley DB 4.8 时

./configure LDFLAGS="-L/home/theusername/bitcoin/db4/lib/" CPPFLAGS="-I/home/theusername/bitcoin/db4/include/


解决:

修改为./configure --with-incompatible-bdb LDFLAGS="-L/home/theusername/bitcoin/db4/lib/" CPPFLAGS="-I/home/theusername/bitcoin/db4/include/"


注意,复制指令的时候,把theusername改为自己的名字

4.测试安装

a. 最后一步 Make success 界面如下:


b.检测安装:

根据《精通比特币》第3章介绍的,我们可以通过询问系统下面2个可执行文件的路径,来确认bitcoin是否安装成功。

出现蓝色框内容,说明安装成功

小伙伴们也再试试看? 还有什么其他问题,就再请补充~

区块链研习社源码研读班 姝婧

相关文章

网友评论

      本文标题:比特币编译记录

      本文链接:https://www.haomeiwen.com/subject/gnvhextx.html