之前在有道云笔记上分享过,但想想还是搬到这里来吧,以后统一方便整理自己的知识进入正题....

之前在调研 hyperledger fabric,其实部署说明官网都有,只是东西都是国外的照着操作也会遇到许多的坑,这里就提前给大家踩雷了,进入正题...

系统环境 linux 16.04+

安装 curl

安装 docker 和 docker-compse

step 1 : docker官网下载 根据自己环境下载指定版本的 *.deb 包 https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/
step 2 : sudo dpkg -i docker-ce_*.deb
step 3 : 通过运行hello-world 映象验证是否安装Docker CE
$ sudo docker run hello-world Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: . The Docker client contacted the Docker daemon. . The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) . The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. . The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/engine/userguide/
step 4 : 修改docker 镜像
sudo vim /etc/docker/daemon.json 添加如下内容
{ "registry-mirrors": ["https://registry.docker-cn.com"] }

修改保存后重启docker 使配置生效,

systemctl restart docker
step 5 : 判断是否安装docker,执行 docker --version
docker-compse 安装方法: 参考资料 https://docs.docker.com/compose/install/#install-compose
step 1 : 运行命令下载最新版本的docker-compse
sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose

step 2 : 对二进制文件应用可执行权限

sudo chmod +x /usr/local/bin/docker-compose

step 3 : 判断是否安装

$ docker-compose --version docker-compose version 1.21., build 5920eb0

安装go

go安装方法: 下载最新压缩包 https://golang.org/dl/
step 1 : 解压安装
tar -C /usr/local -xzf go1.10.1.linux-amd64.tar.gz
使用nano ~/.profile 添加代码
step 2 : 配置
export GOROOT=/usr/local/go export PATH=$GOROOT/bin:$PATH export GOPATH=/opt/gopath
执行 source ~/.profile

安装 Samples, Binaries and Docker Images

创建文件目录
cd /opt sudo mkdir gopath cd gopath/ sudo mkdir src cd src/ sudo mkdir github.com cd github.com/ sudo mkdir hyperledger cd hyperledger/

若能翻墙,则执行

curl -sSL https://goo.gl/6wtTN5 | bash -s 1.1.0
若无法下载,则将该路径的代码拷贝到本地 https://github.com/hyperledger/fabric/blob/master/scripts/bootstrap.sh
将文件中第77行,第80行代码注释掉,且手动下载下面2个文件到目录 /opt/gopath/src/github.com/hyperledger
# curl https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/${ARCH}-${VERSION}/hyperledger-fabric-${ARCH}-${VERSION}.tar.gz | tar xz # curl https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric-ca/hyperledger-fabric-ca/${ARCH}-${VERSION}/hyperledger-fabric-ca-${ARCH}-${VERSION}.tar.gz | tar xz
下载路径 ,根据实际版本选择下载 ,本例为 1.1.0-rcl
解压下载文件,生成文件夹 bin,文件夹下有二进制文件如下
  • cryptogen,
  • configtxgen,
  • configtxlator,
  • peer,
  • orderer, and
  • fabric-ca-client
配置 nano ~/.profile 添加
export PATH=/opt/gopath/src/github.com/hyperledger/bin:$PATH
编译 source ~/.profile
执行 bootstrap.sh
sudo bash bootstrap.sh
docker exec -it cli bash

查询账户a

peer chaincode query -C mychannel -n mycc -c '{"Args":["query","a"]}'

账户a转10给账户b

peer chaincode invoke -o orderer.example.com: --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n mycc -c '{"Args":["invoke","a","b","10"]}'

查看mychannel下的info

 

hyperledger fabric部署总结的更多相关文章

  1. Hyperledger Fabric 部署

    Hyperledger Fabric 部署 Hyperledger Fabric需要使用Docker.Go环境. Docker环境安装 Docker环境安装 直接查看这一篇,安装好之后将当前用户非ro ...

  2. HyperLedger Fabric部署与链码解读

    1.Fabric简介 Fabric是超级账本中的一个项目,用以推进区块链技术.和其他区块链类似,它也有一个账本,使用智能合约,且是一个参与者可以分别管理自身交易的系统.它是一个联盟链.Fabric与其 ...

  3. Hyperledger Fabric 部署在多个主机上

    前言 在实验Hyperledger Fabric无排序组织以Raft协议启动多个Orderer服务.TLS组织运行维护Orderer服务中,我们已经完成了使用提供 TLS-CA 服务的 council ...

  4. HyperLedger Fabric 1.1 手动部署单机单节点

    手动部署单机单节点 之前发布过官方的e2e部署方案,由于环境或是访问权限等各种问题,还是有相当一部分码友无法成功跑起来,故此,本章将来一次纯手动操作的集群部署. 主要需要的步骤如下: 1:环境整理 2 ...

  5. 用Java为Hyperledger Fabric(超级账本)开发区块链智能合约链代码之部署与运行示例代码

    部署并运行 Java 链代码示例 您已经定义并启动了本地区块链网络,而且已构建 Java shim 客户端 JAR 并安装到本地 Maven 存储库中,现在已准备好在之前下载的 Hyperledger ...

  6. Centos7 HyperLedger Fabric 1.4 生产环境部署

    Kafka生产环境部署案例采用三个排序(orderer)服务.四个kafka.三个zookeeper和四个节点(peer)组成,共准备八台服务器,每台服务器对应的服务如下所示: kafka案例网络拓扑 ...

  7. 在Ubuntu中部署并测试HyperLedger Fabric 0.6

    最近开始研究区块链,对这个新兴的技术有了基本概念上的了解,所以打算基于一个开源项目做做实验.如果是做数字货币,那么比特币的源代码是最好的了,不过这算是区块链1.0吧,已经有很多改进的竞争币和山寨币出来 ...

  8. Hyperledger fabric 1.3版本的安装部署(原创多机多Orderer部署

    首先,我们在安装前,要考虑一个问题 Hyperledger Fabric,通过指定的节点进行背书授权,才能完成交易的存储 延伸开来,就是为了实现容错.高并发.易扩展,需要zookeeper来选择排序引 ...

  9. HyperLedger/Fabric SDK使用Docker容器镜像快速部署上线

    HyperLedger/Fabric SDK Docker Image 该项目在github上的地址是:https://github.com/aberic/fabric-sdk-container ( ...

随机推荐

  1. Jquery mobile中用Jquery的append()追加的内容没有Jquery mobile的样式

    Jquery Mobile 动态添加块之后, 样式不是JM内定的样式,解决方案如下: $('#content').append(html).enhanceWithin();//Jquery Mobil ...

  2. 以API方式调用C# dll,使用OneNote2013 sp1实现OCR识别本地图片

    http://www.cnblogs.com/Charltsing/p/OneNoteOCRAPI.html OneNote2013 OCR API调用使用说明2019.4.17 使用说明:1.安装干 ...

  3. c#枚举位运算操作

    抛出预设问题 需要有一个npc需要在一周中的,周一,周二,周三会出现,其他时间不可见 解决问题 因为一周时间是固定的,所以创建枚举类型比较合适,如下 enum Days { None, Sunday, ...

  4. Windows平台安装TensorFlow Q&A

    ·本文讲的是Windows平台使用原生pip进行TensorFlow(CPU版本)安装的注意事项及常见问题解决方法 ·这是TensorFlow官网的安装介绍:在 Windows 上安装 TensorF ...

  5. METO CODE 223 拉力赛

    传送门 继续水板子题... #include <bits/stdc++.h> #define ll long long using namespace std; inline int re ...

  6. python 第三方库的加载与虚拟机的登录

    通过pip来安装python模块(pip方式仅需要联网即可,不需要下载其他文件即可实现扩展库哦的安装.升级和卸载).下载python3.5以上的版本(包括3.5),在我的电脑输入cmd进入命令提示符, ...

  7. GWAS: 阿尔兹海默症和代谢指标在大规模全基因组数据的遗传共享研究

    今天要讲的一篇是发表于 Hum Genet 的 "Shared genetic architecture between metabolic traits and Alzheimer's d ...

  8. 关于 redis 的 数据类型 和 内存模型

    该文章 是在读了 公众号 : java 后端技术 之后 做的一个小记录 原文网址  : https://mp.weixin.qq.com/s/mI3nDtQdlVlLv2uUTxJegA 作者文章写的 ...

  9. 2018-2019-2 网络对抗技术 20165232 Exp4 恶意代码分析

    2018-2019-2 网络对抗技术 20165232 Exp4 恶意代码分析 1.实践目标 监控你自己系统的运行状态,看有没有可疑的程序在运行. 分析一个恶意软件,就分析Exp2或Exp3中生成后门 ...

  10. I2C(四)linux3.4(写代码)

    title: I2C(四)linux3.4(写代码) date: 2019/1/29 17:18:42 toc: true --- I2C(四)linux3.4(写代码) 老师的参考代码 https: ...