eos本地环境部署

# 前言

其实在[官方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/

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 系统环境 macOS Sierra 10.12.6 升级XCode和brew 升级XCode $ xcode-se...
    d71841265e33阅读 1,608评论 1 0
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,107评论 19 139
  • 1 EOS智能合约的介绍1.1 所需背景知识1.2 EOS智能合约基础知识1.3 技术局限性 2 智能合约文件2....
    cenkai88阅读 30,626评论 5 28
  • Philosophy thrives on the understanding of, respect and c...
    大立柜阅读 383评论 0 0
  • 第八章 科学素养与理科教学 一、何谓“科学素养”。科学素养的六个范畴:概念性知识、科学的理智、科学的伦理、科...
    邓仕民重庆阅读 201评论 0 1