运行环境
ubuntu 16.04
参考:GitHub安装说明:https://github.com/EOSIO/eos/tree/dawn-2.x
获取代码
要下载所有的代码,请下载EOS源代码和一个或两个子模块的递归。 最简单的方法是做一个递归克隆:
git clone https://github.com/EOSIO/eos.git -b DAWN-2018-02-14 --recursive
自动编译
cd eos
./build.sh ubuntu full
进入build,目录下
需要进入build目录然后执行以下命令:
cd build
make install
运行一个单节点网络
eos软件编译完成,按照Readme.md上的描述就可以启动一个单节点的网络了。先到eos/build/progrems/eosd目录下,如果你中途没有变更过目录那么使用以下命令即可进入
cd build/progrems/eosd
可以看到里面有一个eosd的可执行文件直接使用命令执行./eosd会得到一个错误(注意这一步是要做的,因为eosd会在当前目录产生一个data-dir的目录),使用ctrl+c停掉eosd之后,进入data-dir目录修改config.ini
# Load the testnet genesis state, which creates some initial block producers with the default key
genesis-json = /path/to/eos/source/genesis.json #注意这个地方要填genesis.json文件的真实路径像在我电脑上就是/Users/wjfree/eos/genesis.json
# Enable production on a stale chain, since a single-node test chain is pretty much always stale
enable-stale-production = true
# 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
注意如果上述在config.ini有默认值,需要将该配置该成与上述一致,同时不能有重名配置项出现在配置文件中。
修改完成保存退出,再回到eosd目录执行./eosd就可以运行起来。可以看到在该测试网络中每3秒就会产生一个块
网友评论