eos本地环境部署

作者: zZ_OoO | 来源:发表于2018-03-04 11:52 被阅读0次

    # 前言

    其实在[官方github](https://github.com/EOSIO/eos)的README上已经写的很清楚了。

    但是中间还是会遇到很多问题有问题可以在帖子下评论。如果解决不了可以去[Telegram](https://t.me/joinchat/EaEnSUPktgfoI-XPfMYtcQ)。

    笔者也是弄了好几天这才在darwin上一键部署成功。建议新手还是使用一键部署,用ubuntu/darwin。

    #下面说一下本地环境部署过程(不过这些github上都有的)

    ## 准备

    1. 首先是从github上克隆eos库:

    `git clone https://github.com/eosio/eos --recursive`

    如果没有安装git,就装一个git。

    2. darwin的话还需要用到`xcode-select`,`Homebrew `这些都是每个开发的mac上必备的,不过也附上官方给的安装代码:

    ```

    xcode-select --install #更新或者安装xcode

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # 安装Homebrew

    ```

    ## 接下来才是真正的安装

    3. 安装

    cd到eos目录执行安装脚本`./build.sh ubuntu/darwin`

    然后就是安装了。基本上不会有什么问题。

    4. 我遇见的error

    中途如果意外停止并且遇到error:`error:/bin/sh: /usr/local/binaryen/bin/s2wasm: No such file or directory`

    那就去这个文件把相关的文件或者文件夹删除,重新安装就可以了。

    5. 配置

    到了这一步就说明你已经安装成功了接下来就是配置了。

    到`build/programs/eosd`目录执行

    `./eosd`

    它会意外停止,不要紧这是正常情况。

    停止以后你会看到eosd文件夹里面多了一个名字为data-dir的文件夹

    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

    # 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

    ```

    这时候你运行肯定会报错,先不要着急,中间还有一个值需要改一下,笔者也是被这个值给害惨了,花了好几个小时。

    配置文件中的`genesis-json = /path/to/eos/source/genesis.json`,需要你改一下path,具体改成什么我知道你懂的,还有一个值,genesis.json这个文件在eos文件夹里,在eos文件夹是找不到source文件夹的,所以找到genesis.json文件夹执行`>pwd`得到文件genesis.json的当前位置,然后复制上去就可以了。

    # 运行

    1. 成功

    在eosd目录下执行eosd文件,应该就会成功了。✌️✌️✌️

    转自https://eosfans.xyz/t/eosben-di-huan-jing-bu-shu/3/

    相关文章

      网友评论

        本文标题:eos本地环境部署

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