雖然eos給了安裝教程,固然仍是用docker最方便。並且如今docker還有阿里雲鏡像,速度快的不要不要的。node
官方教程了https://github.com/EOSIO/eos/...,不過只是想運行的話,也不用build,直接在源碼的Docker目錄下執行:git
$ docker-compose up
就行了,會自動啓動兩個容器:github
eos更新很快,教程更新不及時,截至今天(2018-5-23),教程裏cleos(命令行工具)的配置是有問題的。docker
# 有問題! $ alias cleos='docker-compose exec keosd /opt/eos/bin/cleos -H nodeos'
首先你可能遇到命令不存在,由於路徑變過了,當前是/opt/eosio/bin/cleos
。即使是改變了路徑,發現仍是會報錯:shell
Host and port options (-H, --wallet-host, etc.) have been replaced with -u/--url and --wallet-url Use for example -u http://localhost:8888 or --url https://example.invalid/
錯誤也說明了緣由。
從新配置下發現仍是報錯:api
# 仍是有問題! $ alias cleos='docker-compose exec keosd /opt/eosio/bin/cleos -u http://localhost:8888/' $ cleos get info
Error 3130001: Missing Chain API Plugin Ensure that you have eosio::chain_api_plugin added to your node's configuration! Error Details: Chain API plugin is not enabled
這錯報的真是驚天地泣鬼神,按照提示你死活是搞不對的,由於默認Chain API Plugin
是打開的。工具
實際上是原本就不應連localhost,要連到鏈上去。
修改成:區塊鏈
$ alias cleos='docker-compose exec keosd /opt/eosio/bin/cleos -u http://nodeosd:8888/ --wallet-url http://localhost:8888' $ cleos get info { "server_version": "4e99cf47", "head_block_num": 1975, "last_irreversible_block_num": 1974, "last_irreversible_block_id": "000007b6d7f08fed622ffbf03d516e70d05d6f731cd3157cf5b0215182e0a3aa", "head_block_id": "000007b77d87993ec68eaaa3cf3752433e7a012aeffb41f9d65c2ddda5fe195c", "head_block_time": "2018-05-23T08:07:40", "head_block_producer": "eosio", "virtual_block_cpu_limit": 717591, "virtual_block_net_limit": 7553528, "block_cpu_limit": 99900, "block_net_limit": 1048576 }
好了,終於能夠愉快的使用cleos了。ui
$ alias cleos='docker-compose exec keosd /opt/eosio/bin/cleos -u http://nodeosd:8888/ --wallet-url http://localhost:8888'
cleos便可正常使用。阿里雲