无眠区块链008一步登天我爱编程

从零单排eos#1#本地测试节点搭建&启动

2018-05-07  本文已影响82人  cb42c14ed837

 

获取代码Getting the Code

git clone https://github.com/EOSIO/eos --recursive

git submodule update --init --recursive


系统需求System Requirements (all platforms)

8GB 空闲内存

20GB 空闲硬盘

之前用笔记本内存不够跑不起来,如果性能不足解决方案是可以跑在eos公有测试网络。

为什么要这么多内存,官方的回答是:

系统建议

Linux/Unix 

执行搭建脚本 Run the build script

cd eos/

./eosio_build.sh

搭建确认Build validation

验证安装是否成功(可选)


/home/jack/opt/mongodb/bin/mongod -f /home/jack/opt/mongodb/mongod.conf & export PATH=${HOME}/opt/mongodb/bin:$PATH 

cd /home/jack/vhost/eos/build

make test


top -c 可以看到,测试单核cpu会接近100%

33个测试,花了565.11秒,大概10分钟,有一个失败了,看提示可能是没有装mongodb

MongoDB安装很简单,无需下载源文件,可以直接用apt-get命令进行安装。 

打开终端,输入以下命令:

sudo apt-get install mongodb

安装完成后,在终端输入以下命令查看MongoDB版本:

mongo -version

再来一次ok了。

安装执行Install the executables

cd build

sudo make install

创建启动单节点测试Creating and Launching a Single Node Testnet

cd build/programs/nodeos

./nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::chain_api_plugin --plugin eosio::account_history_api_plugin


获取区块链信息Get chain info

curl http://127.0.0.1:8888/v1/chain/get_info

如下图,有服务器版本,区块头,前一个区块,区块头id,区块时间,区块生成者对应的信息

其他还有docker的玩法,今天先玩到这里。

参考官方eos github的wiki 

https://github.com/EOSIO/eos/wiki/Local-Environment#1-getting-the-code

上一篇 下一篇

猜你喜欢

热点阅读