原文鏈接:https://wangwei.one/posts/181733fc.html
官方文檔:https://github.com/EOSIO/eos
本文介紹如何使用腳本自動構(gòu)建eos源代碼

eos-logo
系統(tǒng)環(huán)境
- macOS Sierra 10.12.6
升級XCode和brew
-
升級XCode
$ xcode-select --install
-
升級brew
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
執(zhí)行構(gòu)建腳本
$ git clone https://github.com/eosio/eos --recursive
$ cd eos
$ ./build.sh darwin
耐心等待構(gòu)建完成,大約 1h20min 左右~構(gòu)建成功后,在~/eos/build/programs中會出現(xiàn)如下四個(gè)文件夾:
- eosc:與區(qū)塊鏈進(jìn)行交互的命令行界面
- eosd:服務(wù)器端區(qū)塊鏈節(jié)點(diǎn)組件
- eos-walletd:EOS錢包
- launcher:節(jié)點(diǎn)網(wǎng)絡(luò)組成和部署的應(yīng)用

QQ20180118-124552
測試
$ cd ~/eos/bulid/tests
$ ./chain_test

eos-tests
創(chuàng)建并啟動單實(shí)例測試網(wǎng)絡(luò)
-
首次運(yùn)行
~/eos/build/programs/eosd目錄下的eosd可執(zhí)行文件,出現(xiàn)錯(cuò)誤后,按Ctrl-C退出。run-eosd-first -
修改
~/eos/build/programs/eosd/data-dir/config.ini配置文件- 設(shè)置
genesis-json文件路徑,在eos跟目錄下 - 設(shè)置
enable-stale-production = true - 在文件末尾追加以下內(nèi)容:
# Enable block production with the testnet producers producer-name = inita producer-name = initb producer-name = initc producer-name = initd producer-name = inite producer-name = initf producer-name = initg producer-name = inith producer-name = initi producer-name = initj producer-name = initk producer-name = initl producer-name = initm producer-name = initn producer-name = inito producer-name = initp producer-name = initq producer-name = initr producer-name = inits producer-name = initt producer-name = initu # Load the block producer plugin, so you can produce blocks plugin = eosio::producer_plugin # Wallet plugin plugin = eosio::wallet_api_plugin # As well as API and HTTP plugins plugin = eosio::chain_api_plugin plugin = eosio::http_plugin - 設(shè)置
-
再次運(yùn)行
eosd,出現(xiàn)如下信息,則成功run-eos-success

