這篇文章主要為大家展示了“EOS區(qū)塊鏈平臺(tái)構(gòu)建開(kāi)發(fā)dapp環(huán)境如何安裝”,內(nèi)容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“EOS區(qū)塊鏈平臺(tái)構(gòu)建開(kāi)發(fā)dapp環(huán)境如何安裝”這篇文章吧。
創(chuàng)新互聯(lián)公司是一家專注于做網(wǎng)站、網(wǎng)站制作與策劃設(shè)計(jì),嵊州網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)公司做網(wǎng)站,專注于網(wǎng)站建設(shè)10年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:嵊州等地區(qū)。嵊州做網(wǎng)站價(jià)格咨詢:18982081108
EOSIO是由三個(gè)component組成的。

nodeos:管理區(qū)塊鏈節(jié)點(diǎn)的組件。
keosd:管理錢(qián)包的組件。
cleos:控制區(qū)塊鏈和錢(qián)包CLI工具。
此文檔以MacOS Darwin 10.12為基準(zhǔn)。
在EOSIO的github庫(kù)下載源碼。
$ git clone https://github.com/EOSIO/eos --recursive
要安裝xcode和homebrew代碼。如果還沒(méi)有安裝的情況,先設(shè)置xcode和homebrew。
xcode : https://developer.apple.com/xcode/
homebrew : https://brew.sh
源代碼包含構(gòu)建腳本及構(gòu)建實(shí)現(xiàn)。
$ cd eos $ ./eosio_build.sh
如果成功的話,就會(huì)出現(xiàn)下面的信息。
[100%] Linking CXX executable unit_test [100%] Built target unit_test _______ _______ _______ _________ _______ ( ____ \( ___ )( ____ \\__ __/( ___ ) | ( \/| ( ) || ( \/ ) ( | ( ) | | (__ | | | || (_____ | | | | | | | __) | | | |(_____ ) | | | | | | | ( | | | | ) | | | | | | | | (____/\| (___) |/\____) |___) (___| (___) | (_______/(_______)\_______)\_______/(_______) EOSIO has been successfully built. 00:11:21 To verify your installation run the following commands: /usr/local/bin/mongod -f /usr/local/etc/mongod.conf & cd /Users/scion/git/eos/build; make test For more information: EOSIO website: https://eos.io EOSIO Telegram channel @ https://t.me/EOSProject EOSIO resources: https://eos.io/resources/ EOSIO Stack Exchange: https://eosio.stackexchange.com EOSIO wiki: https://github.com/EOSIO/eos/wiki
解決問(wèn)題
如果build過(guò)程中出現(xiàn)這樣的error時(shí):
CMake Error at /usr/local/Cellar/cmake/3.11.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Failed to find Gettext libintl (missing: Intl_INCLUDE_DIR) Call Stack (most recent call first): /usr/local/Cellar/cmake/3.11.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) /usr/local/Cellar/cmake/3.11.3/share/cmake/Modules/FindIntl.cmake:47 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) programs/cleos/CMakeLists.txt:29 (find_package)
應(yīng)該是homebrew的gettext連接到了不正確的版本,更改連接信息就可以了:
$ brew link gettext — force
在環(huán)境變量文件(~/.profile)添加gettoxt path:
export PATH=”/usr/local/opt/gettext/bin:$PATH”
參考:https://github.com/EOSIO/eos/issues/2174
也有可能發(fā)生這種情況:
Mac OS 10.13.3 build error “path mongo-cxx-driver already exists”
這樣解決:
sudo rm -rf /tmp/mongo* cd /path/to/eos rm -rf build/ git pull git submodule update — init — recursive ./eosio_build.sh
參考:https://github.com/EOSIO/eos/issues/3197
安裝順利完成。為了驗(yàn)證,執(zhí)行下測(cè)試腳本。
$ /usr/local/bin/mongod -f /usr/local/etc/mongod.conf & $ cd build/ $ make test Running tests... Test project /Users/scion/git/eos/build Start 1: test_cypher_suites 1/35 Test #1: test_cypher_suites ................... Passed 0.04 sec Start 2: validate_simple.token_abi 2/35 Test #2: validate_simple.token_abi ............ Passed 0.08 sec Start 3: validate_eosio.token_abi ... 34/35 Test #34: restart-scenarios-test-hard_replay ... Passed 151.83 sec Start 35: validate_dirty_db_test 35/35 Test #35: validate_dirty_db_test ............... Passed 4.42 sec 100% tests passed, 0 tests failed out of 35
下面完成安裝:
$ cd build $ sudo make install
試著運(yùn)行EOSIO的組件吧。這是為了構(gòu)建開(kāi)發(fā)環(huán)境,所以可以先用一個(gè)節(jié)點(diǎn)。
用帶有option的命令直接執(zhí)行就行了
$ nodeos -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin
其中:
e : 區(qū)塊生成
p eosio : 區(qū)塊生產(chǎn)者名稱 — plugin eosio::chain_api_plugin : 區(qū)塊鏈相關(guān)API插件 — plugin eosio::history_api_plugin : 歷史記錄相關(guān)API插件
可以用配置文件替換參數(shù)。
config file位置: ~/Library/Application Support/eosio/nodeos/config/config.ini
當(dāng)nodeos第一次運(yùn)行時(shí),該文件自動(dòng)生成。
$ vi ~/Library/Application\ Support/eosio/nodeos/config/config.ini ... # enable-stale-production = false enable-stale-production = true ... # producer-name = producer-name = eosio ... plugin = eosio::chain_api_plugin plugin = eosio::history_api_plugin ...
執(zhí)行nodeos :
$ nodeos
如果運(yùn)行正常,可以看到在控制臺(tái)上0.5秒生成block的信息。
為了確認(rèn)nodeos是否正常運(yùn)行,讓我們?cè)囋噾?yīng)用程序API接口。
在運(yùn)行于8888端口的應(yīng)用軟件服務(wù)上試試HTTP Request:
$ curl -k -v 'http://127.0.0.1:8888/v1/chain/get_info' -X GET
Note: Unnecessary use of -X or --request, GET is already inferred.
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
> GET /v1/chain/get_info HTTP/1.1
> Host: 127.0.0.1:8888
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Connection: close
< Content-Length: 529
< Content-type: application/json
< Server: WebSocket++/0.7.0
<
{"server_version":"012dc012","chain_id":"cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f","head_block_num":363,"last_irreversible_block_num":362,"last_irreversible_block_id":"0000016ad0238cef2f6a8de2098115ba155cbbc535122912a7a62f66097adbd6","head_block_id":"0000016b8cbb9154a759f2e61968fc1069fcf0ef9468886614d0538a97d96c61","head_block_time":"2018-06-12T07:10:59","head_block_producer":"eosio","virtual_block_cpu_limit":287075,"virtual_block_net_limit":1506023,"block_cpu_limit":199900,"block_net_limit":1048576}或是利用cleos命令執(zhí)行。
$ cleos get info
{
"server_version": "012dc012",
"chain_id": "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f",
"head_block_num": 580,
"last_irreversible_block_num": 579,
"last_irreversible_block_id": "000002436a1baaeb366b55995ddad7de0822f177d60a8c6e336e3f5fcb18ecc5",
"head_block_id": "00000244e6923239c0649ddada0dd47a2df80df13fa825275df9ddac975e6162",
"head_block_time": "2018-06-12T07:12:48",
"head_block_producer": "eosio",
"virtual_block_cpu_limit": 356561,
"virtual_block_net_limit": 1871085,
"block_cpu_limit": 199900,
"block_net_limit": 1048576
}同樣用帶有option的命令直接執(zhí)行就行了
$ keosd — http-server-address=127.0.0.1:8900
http-server-address : REST API,nodeos默認(rèn)端口是8888。cleos默認(rèn)端口考慮使用8900,URL不可用。
只能通過(guò)替換keosd配置文件選項(xiàng)來(lái)運(yùn)行。
配置文件位置:~/eosio-wallet/config.ini。
第一次keosd操作,文件自動(dòng)生成。
$ vi ~/eosio-wallet/config.ini # http-server-address = 127.0.0.1:8888 http-server-address = 127.0.0.1:8900
執(zhí)行keosd:
$ keosd
在運(yùn)行于8900端口的應(yīng)用軟件服務(wù)上試試HTTP Request:
$ curl -k -v ‘http://127.0.0.1:8900/v1/wallet/list_wallets' -X GET Note: Unnecessary use of -X or — request, GET is already inferred. * Trying 127.0.0.1… * TCP_NODELAY set * Connected to 127.0.0.1 (127.0.0.1) port 8900 (#0) > GET /v1/wallet/list_wallets HTTP/1.1 > Host: 127.0.0.1:8900 > User-Agent: curl/7.54.0 > Accept: */* > < HTTP/1.1 200 OK < Connection: close < Content-Length: 2 < Content-type: application/json < Server: WebSocket++/0.7.0 < []
或者使用cleos命令運(yùn)行:
$ cleos wallet list Wallets: []
nodeos和keosd可以正常工作,現(xiàn)在可以使用EOSIO服務(wù)了。
以上是“EOS區(qū)塊鏈平臺(tái)構(gòu)建開(kāi)發(fā)dapp環(huán)境如何安裝”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
網(wǎng)站名稱:EOS區(qū)塊鏈平臺(tái)構(gòu)建開(kāi)發(fā)dapp環(huán)境如何安裝
文章URL:http://www.chinadenli.net/article14/gpccde.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站制作、網(wǎng)站改版、、關(guān)鍵詞優(yōu)化、網(wǎng)站內(nèi)鏈、外貿(mào)建站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)