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

之前在调研 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. 关于ES6的module的循环加载

    今天写js时,碰到了一个模块循环加载的错误,下面时例子: // testa.mjs import testb from './testb.mjs'; const {b} = testb; const ...

  2. ORM简介

    ORM就是object relational mapping,对象关系映射. 将关系型数据库转化为对象来进行处理. 数据表就是一个类,表的一行就是一个对象,一行的每个字段就是属性. 忽然想到了在MVC ...

  3. 证明与计算(1): Decision Problem, Formal Language L, P and NP

    0x01 从判定问题到形式语言 这篇讲知识证明的wiki([1]): https://en.wikipedia.org/wiki/Proof_of_knowledge 里面有一句话: Let x be ...

  4. 安装Cnario Player 3.8.1.156或其他版本时提示"Warning 4154. Adobe Flash Player 13 ...not correctly installed"

    错误提示 安装Cnario Player 3.8.1.156或其他版本时, 有时会出现如下提示: Warning 4154. Adobe Flash Player 13 ...not correctl ...

  5. Google SRE

    SRE_百度百科 https://baike.baidu.com/item/SRE/1141123 我们离Google SRE还有多远? - 简书https://www.jianshu.com/p/6 ...

  6. php框架之thinkphp

    日常开发中经常使用thinkphp5进行开发工作,总结一些使用中遇到的问题和使用的东西 1. web内置服务 V5.1.5+版本开始,增加了启动内置服务器的指令,方便测试 >php think ...

  7. win 执行puppet

    C:\scripts\win_exec_proxy.bat  \\adsoft.base-fx.com\puppet\puppet\files\Windows_10_x64\C\user\logon\ ...

  8. [搬运] 将 Visual Studio 的代码片段导出到 VS Code

    原文 : A Visual Studio to Visual Studio Code Snippet Converter 作者 : Rick Strahl 译者 : 张蘅水 导语 和原文作者一样,水弟 ...

  9. openstack虚拟机内核崩溃问题解决

    openstack对接的kvm虚拟化环境,创建虚拟机后无法进如系统,一直卡在call Trace . 解决办法: 更改配置文件的cpu-model,libvirt_cpu_mode = custom ...

  10. 互联网+ 何人能挡?带着你的Code飞奔吧!

    Python方向: 早期方向 Web全栈 擅长专栏 爬虫系列 数据分析 人工智能 物联网系(lot万物互联)[逆天很看好未来的前景] 自动化运维(安全与测试) 其他系列 游戏开发(最近很火) 导航栏: ...