前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >EOS docker开发环境

EOS docker开发环境

作者头像
用户1408045
发布2019-03-12 10:18:40
7770
发布2019-03-12 10:18:40
举报
文章被收录于专栏:汇智网教程

使用eos docker镜像是部署本地EOS开发环境的最轻松愉快的方法。使用官方提供的eos docker镜像,你可以快速建立一个eos开发环境,可以迅速启动开发节点和钱包服务器、创建账户、编写智能合约...

EOS Wiki提供了有关如何使用docker容器编译最新版本代码的说明。但可能有它自己的一些问题,因此我们鼓励你在学习时引用下面镜像。这样最初会更容易,更快。

如果你还没有安装docker,请在此处下载。

1.获取docker镜像

以下语句将下载包含已编译软件的Ubuntu镜像。

代码语言:javascript
复制
docker pull eosio/eos

作为快速测试,运行镜像并获取对bash shell的访问权限,请执行以下操作:

代码语言:javascript
复制
docker run --rm -it eosio/eos bash

如果可行,你应该得到如下所示的提示,输入cleos应返回cleos工具的帮助:

代码语言:javascript
复制
root@a5f9eafaab74:/#cleos
ERROR: RequiredError: Subcommand required
Command Line Interface to EOSIO Client
Usage: cleos [OPTIONS] SUBCOMMAND

Options:
  -h,--help                   Print this help message and exit
  -u,--url TEXT=http://localhost:8888/
                              the http/https URL where nodeos is running
  --wallet-url TEXT=http://localhost:8888/
                              the http/https URL where keosd is running
  -v,--verbose                output verbose actions on error

Subcommands:
  version                     Retrieve version information
  create                      Create various items, on and off the blockchain
  get                         Retrieve various items and information from the blockchain
  set                         Set or update blockchain state
  transfer                    Transfer EOS from account to account
  net                         Interact with local p2p network connections
  wallet                      Interact with local wallet
  sign                        Sign a transaction
  push                        Push arbitrary transactions to the blockchain
  multisig                    Multisig contract commands
  system                      Send eosio.system contract action to the blockchain.
root@a5f9eafaab74:/#
root@a5f9eafaab74:/#exit

键入exit退出镜像。

2.创建一个docker网络

创建一个docker网络,允许容器相互通信。

代码语言:javascript
复制
docker network create eosnetwork

3.运行容器

运行服务器软件(在端口7777上):

代码语言:javascript
复制
docker run --name server --network=eosnetwork --rm -p 7777:7777 -i eosio/eos /bin/bash -c "nodeos -e -p eosio --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::http_plugin -d /mnt/dev/data --http-server-address=0.0.0.0:7777 --access-control-allow-origin=*"

要运行钱包软件(在端口5555上):

代码语言:javascript
复制
docker run --name wallet --network=eosnetwork --rm -p 5555:5555 -i eosio/eos /bin/bash -c "keosd --http-server-address=0.0.0.0:5555"

让我们打开一个bash shell,以便我们可以测试一些工具。

代码语言:javascript
复制
docker run --name tools --network=eosnetwork --rm -it eosio/eos /bin/bash 

4.测试下以便确定它是否全部正常工作

现在让我们确保服务器正在运行:

代码语言:javascript
复制
$ cleos -u http://server:7777 get info

# Expected response
{
  "server_version": "749a6759",
  "head_block_num": 1953,
  "last_irreversible_block_num": 1952,
  "last_irreversible_block_id": "000007a0c1ae4e28480dcbeef36e9d4970987969f850453dcf8e244b569d6325",
  "head_block_id": "000007a1fc0d5b3dd16ebfe18ab9a288ac8bc7d03caee050a58a502577d25560",
  "head_block_time": "2018-05-16T02:04:08",
  "head_block_producer": "eosio",
  "virtual_block_cpu_limit": 701979,
  "virtual_block_net_limit": 7389096,
  "block_cpu_limit": 99900,
  "block_net_limit": 1048576
}
代码语言:javascript
复制
$ cleos --wallet-url http://wallet:5555 wallet list keys

# We have not created any wallets yet, so this is the expected response
Wallets:
[]
[]
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2018/12/16 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1.获取docker镜像
  • 2.创建一个docker网络
  • 3.运行容器
  • 4.测试下以便确定它是否全部正常工作
相关产品与服务
容器镜像服务
容器镜像服务(Tencent Container Registry,TCR)为您提供安全独享、高性能的容器镜像托管分发服务。您可同时在全球多个地域创建独享实例,以实现容器镜像的就近拉取,降低拉取时间,节约带宽成本。TCR 提供细颗粒度的权限管理及访问控制,保障您的数据安全。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档