ubuntu16.04下Hyperledger之搭建Fabric环境简单操作(五步启动e2e_cli)
如果你已经安装好go等工具、git及checkout相关代及下载相关镜像,您只需下面5步就能up e2e_cli
~/go/src/github.com/hyperledger/fabric$ sudo chmod 777 release
~/go/src/github.com/hyperledger/fabric$ sudo chmod 777 examples/e2e_cli
~/go/src/github.com/hyperledger/fabric$ sudo chmod 777 examples/e2e_cli/docker-compose-e2e.yaml
~/go/src/github.com/hyperledger/fabric$ sudo chmod -R 777 examples/e2e_cli/channel-artifacts
~/go/src/github.com/hyperledger/fabric$ sudo vi examples/e2e_cli/base/peer-base.yaml
改成 - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=e2e_cli_default,wq存盘退出
ubuntu16.04下Hyperledger之搭建Fabric环境简单操作(五步启动e2e_cli)
http://402133619a.hk35.lfw.cn.com/forum.php?mod=viewthread&tid=3
(出处: 区块云)
~/go/src/github.com/hyperledger/fabric/examples/e2e_cli$ ./network_setup.sh down
~/go/src/github.com/hyperledger/fabric/examples/e2e_cli$ ./network_setup.sh up
如果您是从新的开始,请照着下面步骤来
下载ubuntu16.04(必须是该版本,不要下载最新版本)ISO文件,如果在windows下用虚拟机运行ubunto16.04,还需要下载VMware或Virtualbox,这里安装比较简单,如需帮助另找资料。
以下都可以用户登录后默认目录进行
ubuntu上更改国内资源地址及更新安装源
如果是虚拟机上操作,点击linux界面,按shift+t打开终端,在终端输入,复制时不要复制前面linux的光标提示符:$
$ sudo vi /etc/apt/sources.list
在vi界面上替换成cn
:%s/us./cn./g
更新源
$ sudo apt-get update
然后安装ssh,这样就可以用putty或者SecureCRT之类的客户端远程连接linuxUbuntu了
$ sudo apt-get install ssh
打开ssh远程访问配置
$ sudo vi /etc/ssh/sshd_config,进入vi编辑界面后按/PermitRootLogin
找到PermitRootLogin,按esc键,有方向键把光标移到PermitRootLogin 后按一下a,输入yes #
如下:
PermitRootLogin yes #PermitRootLogin
保存退出后
再ifconfig,记下linux网卡IP,在putty等上输入连接主机时,录入这个IP与用户名密码,就可以远程登录linux了,如果登录不上,重启一下ssh
安装go环境,下载安装压缩包
$ wget https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz
解压缩
$ sudo tar -C /usr/local -xzf go1.9.linux-amd64.tar.gz
配置系统变量以及属性
$ vi ~/.profile
添加变量,直接用我的就可以
export PATH=$PATH:/usr/local/go/bin
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
保存配置文件
$ source ~/.profile
创建go文件夹
$ cd ~
$ mkdir go
安装Docker
如果OS是第一次安装Docker,可先卸载可能存在的旧版本$ sudo apt-get remove docker docker-engine docker-ce docker.io
安装curl
$ sudo apt install curl
安装CA证书,才可以通过HTTPS使用存储库(repository)
$ sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
添加Docker官方的GPG密钥
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
使用下面的命令来设置stable存储库
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
再更新一下apt包索引
$ sudo apt-get update
安装最新版本的Docker CE
$ sudo apt-get install -y docker-ce
检查docker版本
$ docker --version
Docker version 18.03.1-ce, build 9ee9f40
有以上输出则证明docker已安装成功!
安装docker-composeapt-get update,如果有老版的,先删除掉$ sudo pip uninstall docker-compose
$ sudo apt-get install python-pip
$ sudo pip install docker-compose
$ docker-compose --version
docker-compose version 1.21.2, build a133471
docker-py version: 3.3.0
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
安装GIT
$ sudo add-apt-repository ppa:git-core/ppa
$ sudo apt-get update
$ sudo apt-get install git
建立go工程的目录
$ sudo mkdir -p ~/go/src/github.com/hyperledger
这里开始改变目录,进入工程目录
$ cd ~/go/src/github.com/hyperledger
如查之前下载过fabric,则删除
~/go/src/github.com/hyperledger$ rm -rf fabric
重新下载cheout
~/go/src/github.com/hyperledger$ sudo git clone https://github.com/hyperledger/fabric.git
~/go/src/github.com/hyperledger$ cd ~/go/src/github.com/hyperledger/fabric
~/go/src/github.com/hyperledger/fabric$ sudo git checkout v1.0.0
~/go/src/github.com/hyperledger/fabric$ sudo chmod 777 release
~/go/src/github.com/hyperledger/fabric$ sudo chmod 777 examples/e2e_cli
~/go/src/github.com/hyperledger/fabric$ sudo chmod 777 examples/e2e_cli/docker-compose-e2e.yaml
~/go/src/github.com/hyperledger/fabric$ sudo chmod -R 777 examples/e2e_cli/channel-artifacts
~/go/src/github.com/hyperledger/fabric$ sudo vi examples/e2e_cli/base/peer-base.yaml
改成 - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=e2e_cli_default,wq存盘退出
Fabric Docker镜像的下载
进入fabric文件夹下的examples/e2e_cli, 下面我们要测试e2e_cli这个demo
~/go/src/github.com/hyperledger/fabric$ cd ~/go/src/github.com/hyperledger/fabric/examples/e2e_cli/
程序将会通过docker拉取项目所需镜像, 为了统一版本,请指定拉取镜像的版本号
~/go/src/github.com/hyperledger/fabric/examples/e2e_cli$ source download-dockerimages.sh -c x86_64-1.0.0 -f x86_64-1.0.0
或者,两个命令有一个对就行了
~/go/src/github.com/hyperledger/fabric/examples/e2e_cli$ ./download-dockerimages.sh -c x86_64-1.0.0 -f x86_64-1.0.0
下拉时间有点长,等下完再执行启动,如果之前做类似启动,先./network_setup.sh down
~/go/src/github.com/hyperledger/fabric/examples/e2e_cli$ ./network_setup.sh up
第一次运行比较久,耐心等等出错
运气好,等了好久出现
===================== All GOOD, End-2-End execution completed =====================
_____ _ _ ____ _____ ____ _____
| ____| | \ | | | _ \ | ____| |___ \ | ____|
| _| | \| | | | | | _____ | _| __) | | _|
| |___ | |\ | | |_| | |_____| | |___ / __/ | |___
|_____| |_| \_| |____/ |_____| |_____| |_____|
ubuntu16.04下Hyperledger之搭建Fabric环境简单操作(五步启动e2e_cli)的更多相关文章
- ubuntu16.04下安装配置深度学习环境(Ubuntu 16.04/16.10+ cuda7.5/8+cudnn4/5+caffe)
主要参照以下两篇博文:http://blog.csdn.net/g0m3e/article/details/51420565 http://blog.csdn.net/xuzhongxiong/a ...
- ubuntu16.04下安装配置深度学习环境(一、cuda7.5的安装)
1.下载所需要的软件 cuda7.5下载(点击下载链接),cudnn4.0下载 2.安装NVIDIA驱动. 一般有两种方法:1)一种方法是利用"软件和更新"来安装,依次选择 系统设 ...
- ubuntu16.04 下Mongo数据库搭建
一 数据库安装 1.下载自己需要的数据库版本和系统,下载地址:https://www.mongodb.com/download-center/community . 本文下载的为ubuntu 16.0 ...
- Ubuntu16.04下安装破解secureCRT和secureFX的操作记录
本地电脑之前安装的是win10,疲于win10频繁的更新和各种兼容问题,果断放弃win10系统,安装了Ubuntu 16.04系统,现在微信.QQ.钉钉.WPS等都已支持linux版本,所以在Ubun ...
- Ubuntu16.04下LAMP环境的安装与配置
Ubuntu16.04下LAMP环境的安装与配置 最近做个实验需要用到Ubuntu环境的靶场,所以这里介绍下Ubuntu环境下LAMP的安装与配置,话不多说,我们gkd! 1.Apache2的安装 首 ...
- Ubuntu16.04下,rabbimq集群搭建
rabbitmq作为企业级的消息队列,功能很齐全,既可以作为单一的部署模式,又可以做集群的部署模式 单一部署就不说了,就是在一台服务器上部署rabbitmq消息队列,可以参考我的博客:Ubuntu16 ...
- ubuntu16.04下安装opencv3.4.1及其扩展模块
1.源文件下载 opencv-3.4.1.tar.gz(https://github.com/opencv/opencv/releases) opencv_contrib-3.4.1.tar.gz(h ...
- Ubuntu16.04下Neo4j图数据库官网安装部署步骤(图文详解)(博主推荐)
不多说,直接上干货! 说在前面的话 首先,查看下你的操作系统的版本. root@zhouls-virtual-machine:~# cat /etc/issue Ubuntu LTS \n \l r ...
- Ubuntu16.04下Mongodb(离线安装方式|非apt-get)安装部署步骤(图文详解)(博主推荐)
不多说,直接上干货! 说在前面的话 首先,查看下你的操作系统的版本. root@zhouls-virtual-machine:~# cat /etc/issue Ubuntu LTS \n \l r ...
随机推荐
- 第7章 Linux文件与目录管理
目录与路径 相对路径与绝对路径 目录的相关操作 . 代表此层目录 .. 代表上层目录 - 代表前一个工作目录 ~ 代表"目前用户身份"所在的文件夹 ~account 代表accou ...
- 正确计算linux系统内存使用率
参考:https://blog.gesha.net/archives/406/ 图中的例子很典型,就是:多数的linux系统在free命令后会发现free(剩余)的内存很少,而自己又没有开过多的程序或 ...
- November 12th, 2017 Week 46th Sunday
I love you not for who you are, but for who I am with you. 我爱你不是因为你是谁,而是因为跟你在一起,我是谁. I enjoy the fee ...
- November 03rd, 2017 Week 44th Friday
The secret of success is to do the common things uncommonly well. 成功的秘诀就是把平凡的事情做得异常的好. Sometimes you ...
- sql点滴—mysql中查询表的信息
mysql中查询表的信息 查询mysql表字段信息的sql语句 SHOW DATABASES //列出 MySQL Server 数据库. SHOW TABLES [FROM db_name] //列 ...
- 题解 P2701 【[USACO5.3]巨大的牛棚Big Barn】
题面 农夫约翰想要在他的正方形农场上建造一座正方形大牛棚. 他讨厌在他的农场中砍树,想找一个能够让他在空旷无树的地方修建牛棚的地方. 我们假定,他的农场划分成 N x N 的方格.输入数据中包括有树的 ...
- 3、爬虫之selenium模块
一 selenium模块 什么是selenium?selenium是Python的一个第三方库,对外提供的接口可以操作浏览器,然后让浏览器完成自动化的操作. selenium最初是一个自动化测试工具, ...
- Linux基础第一课——基础知识了解
前言 发展历史 linus 林纳斯 赫尔辛基大学 在自己的笔记本上安上自己写的操作系统 基于Linux内核 Linux内核 也是基于unix内核开发出来 unix 不开源 只能军方和大学使用 Linu ...
- InnerClass annotations are missing corresponding EnclosingMember annotations. Such InnerClas...
如果 你的项目中使用了注解插件 比如butterknife 升级3.1之后打包编译 出现以下错误提示 InnerClass annotations are missing correspondi ...
- yield协程
1.Generator Generator , 一种可以返回迭代器的生成器,当程序运行到yield的时候,当前程序就唤起协程记录上下文,然后主函数继续操作,当需要操作的时候,在通过迭代器的next重新 ...