美文网首页EOS
Ubuntu 17.10利用build.sh脚本快速搭建EOS测

Ubuntu 17.10利用build.sh脚本快速搭建EOS测

作者: 小胖暖她爹 | 来源:发表于2018-03-19 11:53 被阅读90次


    作者注:因EOS最新版本较02-14版本改动较大,不推荐采用本文方式安装EOS,最新EOS安装请参考:https://www.jianshu.com/p/c240b646fe36

    首先感谢简书作者王巨的《EOS测试环境快速搭建》,本文增加了在实际操作过程中可能遇到的问题及修复办法。

    一、安装环境

    1、环境:VMware 虚拟机

    2、操作系统:Ubuntu 17.10(Artful) 64位

    PS:github上的EOS官方文档推荐使用16.10版本,实际多次操作未成功。


    二、安装

    1、下载EOS代码

    $ git clone https://github.com/EOSIO/eos.git -b DAWN-2018-02-14 --recursive

    DAWN-2018-02-14: 指定2018-02-14版本,而目前最新版多次安装未成功。

    --recursive: 包含所有子项目,如未添加,可使用git submodule update --init --recursive更新。

    2、编译EOS代码

    $ cd eos

    $ ./build.sh ubuntu full

    build.sh: 编译脚本,在最新版本里build.sh已经更名为eosio_build.sh,两者有何不同会另文分析。

    ubuntu: 指定操作系统为ubuntu,这个版本脚本安装只支持ubuntu和Mac OS,Mac OS输入为darwin。

    full: 完全编译,包括各依赖库和EOS代码,如只需编译EOS代码,可改为build。

    3、安装

    $ cd build

    $ make install

    4、运行

    $ ./install/bin/eosd


    附加:可能报错信息及修复

    Err:

    fc::exists( my->genesis_file ): unable to find genesis file '', check --genesis-json argument

        {"f":""} chain_plugin.cpp:228 plugin_startup {"my->genesis_file.generic_string()":""} chain_plugin.cpp:257 plugin_startup

    Fix:

    此错误会在/eos/build/install/bin/文件夹下生成文件夹data-dir

    $ cd data-dir

    $ vim config.ini

    将以下代码加入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

    # 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

    PS:

    1、此代码用于在测试网内指定21个出块者;

    2、genesis-json =这句原文件已存在,不过是被注释的,可以不用管。将新添的genesis-json = /path/to/eos/source/genesis.json,这句改为自己的genesis.json路径地址;

    3、这里要注意,enable-stale-production = true这句,在配置文件里可能已经存在,值为false,只需修改原值false为true即可,如果重复添加,在运行时会报错。


    Err:

    Dynamic exception type: boost::exception_detail::clone_impl >

    std::exception::what: option 'enable-stale-production' cannot be specified more than once

    Fix:

    该错误为config.ini配置文件内有两句enable-stale-production,打开config.ini,删除或注释掉其中一句,要注意的是该项值须为true。

    参考文献:

    https://www.jianshu.com/u/2c20674f10bb

    https://github.com/EOSIO/eos

    相关文章

      网友评论

        本文标题:Ubuntu 17.10利用build.sh脚本快速搭建EOS测

        本文链接:https://www.haomeiwen.com/subject/rtvuqftx.html