aws上部署eos,比阿里云要简单一些(主要是不用科学上网了)。
eos环境包括3个重要的组件,是一次性安装完成的。
分别是:
- nodeos 服务端组件,负责管理区块链
- keosd 钱包管理组件
-
cleos 交互工具,负责把前两个组件的功能聚合起来
官方的示例图如下:
eos组件关系图
由于不用科学上网,而且Amazon机器是EOS支持机器的第一类,安装是相当顺利的。
- 机器配置
要求8G内存,20G硬盘 - 下载源码
git clone https://github.com/EOSIO/eos --recursive
如果是更新的话,记得更新子模块
git pull
git submodule update --init --recursive
- 编译
cd eos
./eosio_build.sh
是从master分支直接build的。编译过程比较漫长,如果不能确保网络通畅,或者担心有别的事情走开(比如吃饭😀),最好使用后台模式。
nohup ./eosio_build.sh &
编译成功后会输出类似如下的风骚界面。
安装成功
- 测试编译结果
~/opt/mongodb/bin/mongod -f ~/opt/mongodb/mongod.conf &
cd build
make test
测试通过后,可以安装了。
测试结果截图
- 安装
需要sudo权限的,默认情况下,aws的ec2-user使用sudo不用输入密码
cd build
sudo make install
- 运行本地节点
cd build/programs/nodeos
./nodeos -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin
如果输出Not producing block because the irreversible block is too old
的错误,重启nodeos即可解决。
如果输出类似如下日志,就是成功了:
2689000ms thread-0 producer_plugin.cpp:987 produce_block ] Produced block 00000012a1e64b0c... #18 @ 2018-05-31T05:44:49.000 signed by eosio [trxs: 0, lib: 17, confirmed: 0]
2689500ms thread-0 producer_plugin.cpp:987 produce_block ] Produced block 00000013c9d293cf... #19 @ 2018-05-31T05:44:49.500 signed by eosio [trxs: 0, lib: 18, confirmed: 0]
2690000ms thread-0 producer_plugin.cpp:987 produce_block ] Produced block 00000014548306ec... #20 @ 2018-05-31T05:44:50.000 signed by eosio [trxs: 0, lib: 19, confirmed: 0]
2690500ms thread-0 producer_plugin.cpp:987 produce_block ] Produced block 00000015414f3f37... #21 @ 2018-05-31T05:44:50.500 signed by eosio [trxs: 0, lib: 20, confirmed: 0]
2691000ms thread-0 producer_plugin.cpp:987 produce_block ] Produced block 000000163c6e59e6... #22 @ 2018-05-31T05:44:51.000 signed by eosio [trxs: 0, lib: 21, confirmed: 0]
2691500ms thread-0 producer_plugin.cpp:987 produce_block ] Produced block 000000177d5f28c9... #23 @ 2018-05-31T05:44:51.500 signed by eosio [trxs: 0, lib: 22, confirmed: 0]
2692000ms thread-0 producer_plugin.cpp:987 produce_block ] Produced block 0000001845d5311e... #24 @ 2018-05-31T05:44:52.000 signed by eosio [trxs: 0, lib: 23, confirmed: 0]
参考:https://github.com/EOSIO/eos/wiki/Local-Environment#installexecutables
网友评论