随着EOS主网的上线,相信基于EOS的Dapp开发会越来越多,查阅了很多资料相关的开发资料都不是很多,只能自己摸索,按照网上仅有的几篇教程,先git clonehttps://github.com/EOSIO/eos –recursive,然后慢慢编译,然后就陷入了各种报错、各种奔溃的场景。为什么编译不报错的环境都是别人的!!!!。

没办法只能另想办法,突然想到Docker这个神一样的东西(之前的随笔里有一篇是redhat 7.2 内网安装docker),去Docker hub上搜EOS,果然有....https://hub.docker.com/r/eosio/,选取eosio/eos,然后开工,这个镜像不大,200多M,下载之后

 docker pull eosio/eos
docker images
docker.io/eosio/eos latest 01fdb2b0f454 hours ago MB

下载好了,启动镜像:

 docker run --name nodeos -v /home/docker/dockerdata/eosdata:/opt/eos/bin/data-dir -p 8888:8888 -p 9876:9876 -p10023:22 -t eosio/eos nodeosd.sh

 36039ms thread-   chain_plugin.cpp:          plugin_initialize    ] initializing chain plugin
36039ms thread- chain_plugin.cpp: plugin_initialize ] Starting up fresh blockchain with default genesis state.
CHAINBASE: Failed to pin chainbase shared memory (of size 8192 MB) in RAM. Performance degradation is possible.
6 CHAINBASE: Failed to pin chainbase shared memory (of size 340 MB) in RAM. Performance degradation is possible.
36065ms thread- http_plugin.cpp: plugin_initialize ] configured http to listen on 0.0.0.0:
36065ms thread- net_plugin.cpp: plugin_initialize ] Initialize net plugin
36065ms thread- net_plugin.cpp: plugin_initialize ] host: 0.0.0.0 port:
36065ms thread- net_plugin.cpp: plugin_initialize ] my node_id is cd8092582bcd89ffe102968f67e058cefa284d43977d28fee1fac2200b78c8de
36066ms thread- main.cpp: main ] nodeos version 012dc012
36066ms thread- main.cpp: main ] eosio root is /root/.local/share
36066ms thread- controller.cpp: startup ] No head block in fork db, perhaps we need to replay
36066ms thread- controller.cpp: initialize_fork_db ] Initializing new blockchain with genesis state
36101ms thread- chain_plugin.cpp: plugin_startup ] starting chain in read/write mode
36101ms thread- chain_plugin.cpp: plugin_startup ] Blockchain started; head block is #, genesis timestamp is --01T12::00.000
36101ms thread- http_plugin.cpp: plugin_startup ] start listening for http requests
36101ms thread- chain_api_plugin.cpp: plugin_startup ] starting chain_api_plugin
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/chain/abi_bin_to_json
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/chain/abi_json_to_bin
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/chain/get_abi
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/chain/get_account
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/chain/get_block
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/chain/get_block_header_state
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/chain/get_code
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/chain/get_currency_balance
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/chain/get_currency_stats
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/chain/get_info
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/chain/get_producers
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/chain/get_required_keys
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/chain/get_table_rows
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/chain/push_block
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/chain/push_transaction
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/chain/push_transactions
36101ms thread- history_api_plugin.cpp: plugin_startup ] starting history_api_plugin
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/history/get_actions
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/history/get_controlled_accounts
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/history/get_key_accounts
36101ms thread- http_plugin.cpp: add_handler ] add api url: /v1/history/get_transaction
36102ms thread- net_plugin.cpp: plugin_startup ] starting listener, max clients is
36102ms thread- producer_plugin.cpp: plugin_startup ] producer plugin: plugin_startup() begin
36102ms thread- producer_plugin.cpp: plugin_startup ] Launching block production for producers at --13T11::36.102.
36102ms thread- producer_plugin.cpp: plugin_startup ] producer plugin: plugin_startup() end

有两个Failed,我测试下来暂时未发现有什么影响,暂且跳过不管(网上也有人说至少需要8G,这个后续有问题我会再更新处理)。有人反馈界面会卡在这里,其实Ctrl + C退出也没关系,容器还是会一直运行。

docker exec -it nodeos /bin/bash 进入容器,

ps:通过上述方式进入容器不是很方便,这里提供一种方式给容器安装ssh服务(虽然不推荐这么做,为了省事还是....)

#进入容器后执行如下代码

#对于不能上网的需要设置代理的需要将代理两行放开
#proxy=192.168.1.100: &&\
#export http_proxy=http://${proxy} &&\
echo 'root:root' |chpasswd &&\
apt-get update &&\
apt-get -y install openssh-server &&\
sed -ri 's/^#PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config && \
sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config && \
/etc/init.d/ssh start

进入 /opt/eosio/bin,EOS相关的命令都在这里

cd /opt/eosio/bin
ls -rtl
total
-rwxr-xr-x. root root Jun : nodeosd.sh
-rwxr-xr-x. root root Jun : eosio-s2wasm
-rwxr-xr-x. root root Jun : eosio-wast2wasm
-rwxr-xr-x. root root Jun : eosio-launcher
-rwxr-xr-x. root root Jun : keosd
-rwxr-xr-x. root root Jun : eosio-abigen
-rwxr-xr-x. root root Jun : nodeos
-rwxr-xr-x. root root Jun : cleos
drwxr-xr-x. root root Jun : data-dir

核心关注的命令是cleos、nodeos、keosd。

cleos:命令行程序,通过命令行执行相应命令,如钱包、转账等操作

 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:8900/
the http/https URL where keosd is running
-r,--header pass specific HTTP header; repeat this option to pass multiple headers
-n,--no-verify don't verify peer certificate when using HTTPS
-v,--verbose output verbose actions on error
--print-request print HTTP request to STDERR
--print-response print HTTP response to STDERR 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.

nodes:是一个挖矿的客户端,启动之后会开始挖矿,容器启动命令里nodeosd.sh,就是启动了一个nodes。

keosd:主要和钱包相关。

至此基于Docker的Eos环境搭建完毕,下一篇将开始EOS Dapp开发。

EOS Dapp开发(1)-基于Docker的开发环境搭建的更多相关文章

  1. Ubuntu 基于Docker的TensorFlow 环境搭建

    基于Docker的TensorFlow 环境搭建 基于(ubuntu 16.04LTS/ubuntu 14.04LTS) 一.docker环境安装 1)更新.安装依赖包 sudo apt-get up ...

  2. 十大基于Docker的开发工具

    http://www.infoq.com/cn/news/2014/08/top-10-open-source-docker FlynnFlynn是一个使用Go语言编写的开源PaaS平台,Flynn使 ...

  3. ArcGIS Pro开发Web3D应用(1)——环境搭建与初始实例

    1.搭建环境 1.1 ArcGIS Web3D软件环境 ArcGIS Pro 2.0(必须) ArcGIS for Enterprise 10.5.1 (从10.5开始称呼为Enterprise)包括 ...

  4. [转]GeoServer地图开发解决方案(一):环境搭建篇

    GeoServer 是 OpenGIS Web 服务器规范的 J2EE 实现的社区开源项目,利用 GeoServer 可以方便的发布地图数据,允许用户对特征数据进行更新.删除.插入操作,通过 GeoS ...

  5. 基于Python的Appium环境搭建合集

    自动化一直是测试圈中的热聊,也是大家追求的技术方向.在测试中,往往回归测试也是测试人员的“痛点”.对于迭代慢.变更少的功能,就能用上自动化来替代人工回归,减轻工作量. 问题 在分享环境搭建之前,先抛出 ...

  6. 基于Docker在Win10平台搭建Ruby on Rails 6.0框架开发环境

    原文转载自「刘悦的技术博客」https://v3u.cn/a_id_170 2020年,"非著名Web框架"–Ruby on Rails已经15岁了.在今年,Rails 6.0趋于 ...

  7. windows下用ADT进行android NDK开发的具体教程(从环境搭建、配置到编译全过程)

    郑重申明:如需转载本博客,请注明出处,谢谢! 这几天在学习android NDK的开发.那么首先让我们来看看android NDK开发的本质是什么. NDK(Native Development Ki ...

  8. [终极巨坑]golang+vue开发日记【一】,环境搭建篇

    写在前面 这个golang+vue大部分的内容是基于bydmm(橙卡)大佬的视频学来的,我在这里只是做一下个人开发的笔记,就是图一个乐,毕竟我只是个应届毕业生,如果真的要学请:bydmm的b站空间. ...

  9. 建立基于docker的编译环境

    如果我们要在一台开发主机上搭一个编译环境,我们需要安装一堆依赖库和编译工具.如果我们有多个不同的项目同时进行,这些项目的编译工具和依赖库又都不一样,如果我们把这些东西全都塞到一台机器里,会不会有冲突呢 ...

随机推荐

  1. MySQL索引覆盖

    什么是“索引覆盖”? 简单来的说,就是让查询的字段(包括where子句中的字段),都是索引字段.索引覆盖的好处是什么?好处是极大的.极大的.极大的提高查询的效率!重要的说三遍! 特别说明: 1.whe ...

  2. 访问GitLab的PostgreSQL数据库

    1.登陆gitlab的安装服务查看配置文件 cat /var/opt/gitlab/gitlab-rails/etc/database.yml production: adapter: postgre ...

  3. jQuery语法小结(超实用)

    1.关于页面元素的引用 通过jquery的$()引用元素包括通过id.class.元素名以及元素的层级关系及dom或者xpath条件等方法,且返回的对象为jquery对象(集合对象),不能直接调用do ...

  4. PHP-006

    Q:应用程序执行时的路径 "D:\*******\protected\runtime" 是无效的. 请确定它是一个可被 Web server process 写入资料的目录. A: ...

  5. 08python之列表的常用方法

    列表list是python常用的数据类型,需要掌握以下常用方法: name_list = ['alex','tenglan','65brother'] 这个变量和之前的变量只存一个数字或字符串,这个列 ...

  6. ftp简单命令

    1.连接ftp ftp 192.168.10.15 进去后输入用户名 ,然后再输入密码,就这样登陆成功了,你会看到 ftp> 2.进入ftp后,你对目录需要切换操作.和linux一样的命令.cd ...

  7. m2014-architecture-imgserver->Lighttpd Mod_Cache很简单很强大的动态缓存

    Lighttpd是一个德国人领导的开源软件,其根本的目的是提供一个专门针对高性能网站,安全.快速.兼容性好并且灵活的web server环境.具有非常低的内存开销,cpu占用率低,效能好,以及丰富的模 ...

  8. mqtt 服务器与客户端通讯

    mqtt 服务器与客户端通讯. 服务器端 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 ...

  9. 《转》我眼中的C# 3.0

    本文转载自Allen Lee's Magic 缘起 每次有新技术发布时,我们总能感受到两种截然不同的情绪:一种是恐惧和抵抗,伴随着这种情绪的还有诸如"C# 2.0用的挺好的,为什么要在C# ...

  10. 《转》python学习(9)字典

    转自 http://www.cnblogs.com/BeginMan/p/3156960.html 一.映射类型 我理解中的映射类型是:键值对的关系,键(key)映射值(value),且它们是一对多的 ...