系統(tǒng)環(huán)境
macOS Sierra 10.12.6
升級XCode和brew
升級XCode
$ xcode-select --install
升級brew
$ ruby -e "$(curl -fsSL[url=https://raw.githubusercontent.com/Homebrew/install/master/instal]https://raw.githubusercontent. ... nstal[/url]l)" ?
執(zhí)行構(gòu)建腳本
$ git clone[url=https://github.com/eosio/eos]https://github.com/eosio/eos[/url] --recursive$ cd eos$ ./build.sh darwin
耐心等待構(gòu)建完成,大約 1h20min 左右~構(gòu)建成功后,在~/eos/build/programs中會(huì)出現(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)用
測試
$ cd ~/eos/bulid/tests
$ ./chain_test

創(chuàng)建并啟動(dòng)單實(shí)例測試網(wǎng)絡(luò)
首次運(yùn)行~/eos/build/programs/eosd?目錄下的eosd可執(zhí)行文件,出現(xiàn)錯(cuò)誤后,按Ctrl-C退出。

修改~/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
再次運(yùn)行eosd,出現(xiàn)如下信息,則成功