Ubuntu 下開始準(zhǔn)備編譯比特幣

Ubuntu 下開始準(zhǔn)備編譯比特幣


Ubuntu 16.04.我是裝在了虛擬機(jī)上,參考菜菜子的文章來(lái)配置的

聊聊比特幣(Bitcoin)客戶端源碼編譯那些事

一、安裝第三方

首先繞過(guò)前人遇見(jiàn)的坑

sudo vi /etc/resolv.conf

然后把 nameserver 這修改如下

nameserver=8.8.8.8

然后再開始第一步

sudo apt-get update

一開始就出了個(gè)問(wèn)題 虛擬機(jī)我配置的橋接 ?剛執(zhí)行第一個(gè)命令就提示各種域名無(wú)法解析?

ubuntu linux裝后為什么不能上網(wǎng)啊??÷

用了下萬(wàn)能的收索引擎 才知道需要配置網(wǎng)卡 第一次使用Ubuntu 這種linux/unix 操作系統(tǒng) 慢慢爬坑吧 ?因?yàn)槲矣胕fconfig已經(jīng)檢查了網(wǎng)卡配置顯示是正常的 同時(shí)能夠ping通網(wǎng)關(guān) 于是我只是把DNS加了114.114.114.114進(jìn)去就可以上網(wǎng)了

再次執(zhí)行第一步 沒(méi)問(wèn)題

然后繼續(xù)

sudo apt-get upgrade


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

sudo apt-get install libboost-all-dev

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

sudo apt-get install libqrencode-dev

sudo apt-get install libminiupnpc-dev

二、下載源碼

先安裝git

cd ~

sudo apt install git

然后用 git 下載

git clone https://github.com/bitcoin/bitcoin.git


三、安裝比特幣客戶端

創(chuàng)建目錄

cd bitcoin

mkdir db4/

下載berkeley-db安裝包,我按下面的命令 是能下載成功的?

wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz


tar -xzvf db-4.8.30.NC.tar.gz

cd db-4.8.30.NC/build_unix/

../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/home/theusername/bitcoin/db4/

make

sudo make install

比特幣(Bitcoin)客戶端的安裝

cd ~/bitcoin/

./autogen.sh

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

configure:error: libdb_cxx headers missing, Bitcoin Corerequiresthis libraryforwallet functionality (--disable-wallet todisablewallet functionality)

查了下 參考?blog.csdn.net/terminatorsong/article/details/74089911?

看了下文檔,提示需要libdb5.1。查查問(wèn)題的時(shí)候都是關(guān)于bitcoin的,提到的都是要使用BerkeleyDb4.8NC。CentOS沒(méi)有l(wèi)ibdb,只能手動(dòng)安裝BerkeleyDb5.1。在doc/build-unix.md文檔里有詳細(xì)的說(shuō)明,按說(shuō)明操作安裝即可

cd ~

wget http://download.oracle.com/berkeley-db/db-5.1.29.NC.tar.gz

echo '08238e59736d1aacdd47cfb8e68684c695516c37f4fbe1b8267dde58dc3a576c db-5.1.29.NC.tar.gz' | sha256 sum -c

tar -xzvf db-5.1.29.NC.tar.gz

cd db-5.1.29.NC/build_unix/

../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/usr/local

sudo make install

重新再來(lái)

cd bitcoin

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

error: Found Berkeley DB other than 4.8, required for portable wallets (–with-incompatible-bdb to ignore), run the following command instead. You can always send your bitcoins to another wallet.

提示安裝的DB不是4.8的版本,使用下邊的命令跳過(guò)DB的版本檢測(cè)

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

error:libevent not found?

缺少庫(kù) 沒(méi)啥好說(shuō)的 安裝

cd ~

sudo apt-get install libevent-dev

再次重來(lái)

cd bitcoin

./configure --with-incompatible-bdbLDFLAGS="-L/home/theusername/bitcoin/db4/lib/" CPPFLAGS="-I/home/theusername/bitcoin/db4/include/"

make

sudo make install


四、安裝完成了驗(yàn)證下

?which bitcoind

?which bitcoin-cli

兩條命令 均會(huì)返回一個(gè)具體路徑 我就不貼了


區(qū)塊鏈研習(xí)社比特幣源碼研讀班 ?孤少

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 了解底層的技術(shù),能夠更好的理解區(qū)塊鏈。因此,決定跟隨菜菜子的腳步,從代碼的角度,看看比特幣的實(shí)現(xiàn)原理。 比特幣客戶...
    electroman閱讀 2,772評(píng)論 0 9
  • 身為一個(gè)程序猿,面對(duì)用高手編程實(shí)現(xiàn)的比特幣,不研究下源碼實(shí)在說(shuō)不過(guò)去。廢話少說(shuō),直奔主題。第一節(jié)是關(guān)于比特幣源碼的...
    Jacky_2c9f閱讀 1,915評(píng)論 0 2
  • 最近想研究下比特幣源碼,首先得安裝下編譯環(huán)境,我首先按源碼中build-osx.md文檔中在mac中設(shè)置了下環(huán)境。...
    ttblack閱讀 3,391評(píng)論 3 5
  • 小時(shí)候 我家門前是座果園 枇杷,石榴,楊梅…… 唇留齒香在回憶 年少時(shí) 菜園只剩下一角 奶奶忙碌的身影少了 菜籃也...
    十二月的雪飄閱讀 459評(píng)論 7 8
  • 01 幅員遼闊的大草原上,有漫山遍野的綠油油的草地,草地上有許多野花,紅的,白的,黃的,粉的,競(jìng)相點(diǎn)綴著漫漫曠野。...
    筆尖兒愛(ài)寫作閱讀 1,190評(píng)論 0 6

友情鏈接更多精彩內(nèi)容