容器部署 Hyperledger Fabric 详细教程

尊重版权,如下主要转自  https://github.com/yeasy/docker-compose-files/blob/master/hyperledger_fabric/docs/steps.md

原作者是IBM Fabric的参与者。


作者编写了使用容器部署Fabric开发测试环境的yaml脚本,方便我们使用。

https://github.com/yeasy/docker-compose-files

如下是极简的1org 1peer的配置

# https://github.com/yeasy/files/tree/master/hyperledger
# This compose file will start a Hyperledger Fabric 1.0 MVE, including
# * 1 ca
# * 1 orderer
# * 1 peer
# * cli for testing

version: '2.0'

services:
  orderer.example.com:  # There  can be multiple orderers
    extends:
      file: base-dev.yaml
      service: orderer.example.com
    depends_on:
      - kafka0
      - kafka1
      - kafka2
      - kafka3

  peer0.org1.example.com:
    extends:
      file: base-dev.yaml
      service: peer0.org1.example.com
    depends_on:
      - orderer.example.com

  cli:
    extends:
      file: base-dev.yaml
      service: cli
    depends_on:
      - peer0.org1.example.com
      - orderer.example.com

# ZooKeeper services, at least 3 nodes
  zookeeper0:
    extends:
      file: base-kafka.yaml
      service: zookeeper0

  zookeeper1:
    extends:
      file: base-kafka.yaml
      service: zookeeper1

  zookeeper2:
    extends:
      file: base-kafka.yaml
      service: zookeeper2

# Kafka services, at least 4 node to tolerant work with 1 node failure
  kafka0:
    extends:
      file: base-kafka.yaml
      service: kafka0
    depends_on:
      - zookeeper0
      - zookeeper1
      - zookeeper2

  kafka1:
    extends:
      file: base-kafka.yaml
      service: kafka1
    depends_on:
      - zookeeper0
      - zookeeper1
      - zookeeper2

  kafka2:
    extends:
      file: base-kafka.yaml
      service: kafka2
    depends_on:
      - zookeeper0
      - zookeeper1
      - zookeeper2

  kafka3:
    extends:
      file: base-kafka.yaml
      service: kafka3
    depends_on:
      - zookeeper0
      - zookeeper1
      - zookeeper2

#networks:
#  default:
#    external:
#      name: hyperledger_fabric

git clone https://github.com/yeasy/docker-compose-files.git

然后到 hyperledger_fabric/v1.4.0 目录下,按照  https://github.com/yeasy/docker-compose-files/blob/master/hyperledger_fabric/docs/steps.md  一步一步来即可。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值