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 ...
随机推荐
- MySQL二进制日志文件Binlog的三种格式以及对应的主从复制中三种技术
二进制日志文件Binlog的格式主要有三种: 1.Statement:基于SQL语句级别的Binlog,每条修改数据的SQL都会保存到Binlog里面. 2.ROW:基于行级别,每一行数据的变化都会记 ...
- 乘风破浪:LeetCode真题_028_Implement strStr()
乘风破浪:LeetCode真题_028_Implement strStr() 一.前言 这次是字符串匹配问题,找到最开始匹配的位置,并返回. 二.Implement strStr() 2.1 ...
- 打开word文档时提示“Microsoft Office Word已停止工作”
我的电脑(Win10)有Office 2003和2013两个版本,可能由于之前超长待机等原因导致word 2003的文件(.doc)不能正常打开,没次都会提示“Microsoft Office Wor ...
- pip安装python模块遇到一直出现retrying的问题
最近安装python模块,遇到这样的一个问题如图所示: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status= ...
- SVG绘制图形
一.SVG介绍 1.SVG指可伸缩矢量图片 2.SVG用来定义用于网络的基于矢量的图形 3.SVG使用XML格式定义图形 4.SVG图像在放大或改变尺寸的情况下其图形质量不会有损失 5.SVG是万维网 ...
- php 导出导入excel
首先需要去官网https://github.com/PHPOffice/PHPExcel/下载PHPExcel,下载后只需要Classes目录下的文件即可. 链接: https://pan.baidu ...
- Jenkins RCE(CVE-2018-1000861)
先说通过IDEA利用JPDA远程调试tomcat程序 在catalina.sh添加,或者catalina.bat内容不动用如下命令开启,默认是开启8000端口 set JAVA_OPTS=-Xdebu ...
- day4-课堂笔记
变量 成员变量-构造方法里定义 self.xxx 使用:类内部: self.xxx 类外部: 先创建实例 实例.xxx 类变量 类定义下面直接定义 使用:类方法内 cls.xxx 类名.xxx sel ...
- 爬虫header和cookie
def on_start(self): self.crawl('http://bbs.byr.cn/board/Python', headers={'X-Requested-With': 'XMLHt ...
- DataGridView如何绑定DataRow对象集合
DataGridView对象是我们在进行Winform程序开发中经常使用的呈现数据的控件,而数据则是通过DataSource这个Property来设置的.根据MSDN的说明,DataGridView对 ...