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是否安裝成功。
出現藍色框內容,說明安裝成功
小伙伴們也再試試看? 還有什么其他問題,就再請補充~
區塊鏈研習社源碼研讀班 姝婧