New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EOS 部署尝试 #4

Closed
kaidiren opened this Issue Mar 12, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@kaidiren
Owner

kaidiren commented Mar 12, 2018

基础条件

  1. docker
  2. git

如果不知道怎么安装请,自己百度 或 者 google, 这里就不详细说明了. 为什么使用docker 是因为构建过程依赖复杂,还很耗费时间所以直接使用dockerhub上构建好的镜像.

下载项目和配置

git clone https://github.com/EOSIO/eos.git
cd eos/Docker
docker pull eosio/eos

编辑 docker-compose.yml 文件, 替换为:

version: "2"

services:
  eosiod:
    image: eosio/eos
    command: /opt/eosio/bin/start_eosiod.sh
    ports:
      - 8888:8888
      - 9876:9876
    expose:
      - "8888"
    volumes:
      - eosiod-data-volume:/opt/eosio/bin/data-dir
      - ./config.ini:/opt/eosio/bin/data-dir/config.ini

  walletd:
    image: eosio/eos
    command: /opt/eosio/bin/eosiowd
    links:
      - eosiod
    volumes:
      - walletd-data-volume:/opt/eosio/bin/data-dir

volumes:
  eosiod-data-volume:
  walletd-data-volume:

项目启动与重启

执行 docker-compose up 启动文件

如果想要修改配置文件, 直接编辑当前目录下的 config.ini, 修改完成后, 执行 docker-compose down -v, docker-compose up 即可.

命令行执行体验

可以在 ~/.bashrc 中添加如下命令

alias eosioc='docker-compose exec walletd /opt/eosio/bin/eosioc -H eosiod'

添加完记得 soucre ~/.bashrc 促使生效

这样子可以直接通过 终端执行 eosioc, 其实实际上已经访问到 docker 内部,非常方便

执行 eosioc get info
可以看到返回结果类似:

{
  "server_version": "3d4a14f1",
  "head_block_num": 4487,
  "last_irreversible_block_num": 4486,
  "head_block_id": "00001187af48142b9b9ab3120799e828c90e064c663e055020fface4440e5736",
  "head_block_time": "2018-03-12T08:42:42",
  "head_block_producer": "eosio",
  "recent_slots": "1110111111111111111111111111111111111111111111111111111111111111",
  "participation_rate": "0.98437500000000000"
}

@kaidiren

This comment has been minimized.

Owner

kaidiren commented Apr 11, 2018

version: "3"

services:
  nodeosd:
    image: eosio/eos
    command: /opt/eosio/bin/nodeosd.sh
    hostname: nodeosd
    ports:
      - 8888:8888
      - 9876:9876
    expose:
      - "8888"
    volumes:
      - nodeos-data-volume:/opt/eosio/bin/data-dir

  keosd:
    image: eosio/eos
    command: /opt/eosio/bin/keosd
    hostname: keosd
    links:
      - nodeosd
    volumes:
      - keosd-data-volume:/opt/eosio/bin/data-dir

volumes:
  nodeos-data-volume:
  keosd-data-volume:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment