本博客主要记录搭建一个3个排序节点、4个组织的每个组织各2个节点的fabric区块链网络

单机部署多节点网络

  • 1、相关环境的安装与配置
  • 2、生成相关的证书文件
  • 3、生成相关的通道配置文件
  • 4、生成docker-compose.yaml的启动文件
  • 5、通道相关配置操作
  • 6、链码调用

1、相关环境的安装与配置

官方文档
安装Git
安装CUrl
安装Go
安装Docker
安装Docker-compose
go、docker、docker-compose,fabric的相关docker镜像、官方的fabric-samples文件、相关fabric二进制文件,具体配置之后补充

2、生成相关的证书文件

1)将下面的内容写入到crypto-config.yaml文件中


# ---------------------------------------------------------------------------
# "OrdererOrgs" - Definition of organizations managing orderer nodes
# ---------------------------------------------------------------------------
OrdererOrgs:# ---------------------------------------------------------------------------# Orderer# ---------------------------------------------------------------------------- Name: OrdererDomain: example.comEnableNodeOUs: true# ---------------------------------------------------------------------------# "Specs" - See PeerOrgs below for complete description# ---------------------------------------------------------------------------Specs:- Hostname: orderer0- Hostname: orderer1- Hostname: orderer2# ---------------------------------------------------------------------------
# "PeerOrgs" - Definition of organizations managing peer nodes
# ---------------------------------------------------------------------------
PeerOrgs:# ---------------------------------------------------------------------------# Org1# ---------------------------------------------------------------------------- Name: Org1Domain: org1.supervisor.comEnableNodeOUs: true# ---------------------------------------------------------------------------# "CA"# ---------------------------------------------------------------------------# Uncomment this section to enable the explicit definition of the CA for this# organization.  This entry is a Spec.  See "Specs" section below for details.# ---------------------------------------------------------------------------# CA:#    Hostname: ca # implicitly ca.org1.example.com#    Country: US#    Province: California#    Locality: San Francisco#    OrganizationalUnit: Hyperledger Fabric#    StreetAddress: address for org # default nil#    PostalCode: postalCode for org # default nil# ---------------------------------------------------------------------------# "Specs"# ---------------------------------------------------------------------------# Uncomment this section to enable the explicit definition of hosts in your# configuration.  Most users will want to use Template, below## Specs is an array of Spec entries.  Each Spec entry consists of two fields:#   - Hostname:   (Required) The desired hostname, sans the domain.#   - CommonName: (Optional) Specifies the template or explicit override for#                 the CN.  By default, this is the template:##                              "{{.Hostname}}.{{.Domain}}"##                 which obtains its values from the Spec.Hostname and#                 Org.Domain, respectively.#   - SANS:       (Optional) Specifies one or more Subject Alternative Names#                 to be set in the resulting x509. Accepts template#                 variables {{.Hostname}}, {{.Domain}}, {{.CommonName}}. IP#                 addresses provided here will be properly recognized. Other#                 values will be taken as DNS names.#                 NOTE: Two implicit entries are created for you:#                     - {{ .CommonName }}#                     - {{ .Hostname }}# ---------------------------------------------------------------------------# Specs:#   - Hostname: foo # implicitly "foo.org1.example.com"#     CommonName: foo27.org5.example.com # overrides Hostname-based FQDN set above#     SANS:#       - "bar.{{.Domain}}"#       - "altfoo.{{.Domain}}"#       - "{{.Hostname}}.org6.net"#       - 172.16.10.31#   - Hostname: bar#   - Hostname: baz# ---------------------------------------------------------------------------# "Template"# ---------------------------------------------------------------------------# Allows for the definition of 1 or more hosts that are created sequentially# from a template. By default, this looks like "peer%d" from 0 to Count-1.# You may override the number of nodes (Count), the starting index (Start)# or the template used to construct the name (Hostname).## Note: Template and Specs are not mutually exclusive.  You may define both# sections and the aggregate nodes will be created for you.  Take care with# name collisions# ---------------------------------------------------------------------------Template:Count: 2# Start: 5# Hostname: {{.Prefix}}{{.Index}} # default# SANS:#   - "{{.Hostname}}.alt.{{.Domain}}"# ---------------------------------------------------------------------------# "Users"# ---------------------------------------------------------------------------# Count: The number of user accounts _in addition_ to Admin# ---------------------------------------------------------------------------Users:Count: 1# ---------------------------------------------------------------------------# Org2: See "Org1" for full specification# ---------------------------------------------------------------------------- Name: Org2Domain: org2.build.comEnableNodeOUs: trueTemplate:Count: 2Users:Count: 1- Name: Org3Domain: org3.supplier.comEnableNodeOUs: trueTemplate:Count: 2Users:Count: 1- Name: Org4Domain: org4.logistics.comEnableNodeOUs: trueTemplate:Count: 2Users:Count: 1

2)根据crypto-config.yaml生成相关的证书文件,生成的证书文件会在./crypto-config/文件夹下

cryptogen命令参考

cryptogen generate --config=crypto-config.yaml

3、生成相关的通道配置文件

1)在configtx.yaml文件下写入如下内容

# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#---
################################################################################
#
#   Section: Organizations
#
#   - This section defines the different organizational identities which will
#   be referenced later in the configuration.
#
################################################################################
Organizations:# SampleOrg defines an MSP using the sampleconfig.  It should never be used# in production but may be used as a template for other definitions- &OrdererOrg# DefaultOrg defines the organization which is used in the sampleconfig# of the fabric.git development environmentName: OrdererOrg# ID to load the MSP definition asID: OrdererMSP# MSPDir is the filesystem path which contains the MSP configurationMSPDir: crypto-config/ordererOrganizations/example.com/msp# Policies defines the set of policies at this level of the config tree# For organization policies, their canonical path is usually#   /Channel/<Application|Orderer>/<OrgName>/<PolicyName>Policies:Readers:Type: SignatureRule: "OR('OrdererMSP.member')"Writers:Type: SignatureRule: "OR('OrdererMSP.member')"Admins:Type: SignatureRule: "OR('OrdererMSP.admin')"- &Org1# DefaultOrg defines the organization which is used in the sampleconfig# of the fabric.git development environmentName: Org1MSP# ID to load the MSP definition asID: Org1MSPMSPDir: crypto-config/peerOrganizations/org1.supervisor.com/msp# Policies defines the set of policies at this level of the config tree# For organization policies, their canonical path is usually#   /Channel/<Application|Orderer>/<OrgName>/<PolicyName>Policies:Readers:Type: SignatureRule: "OR('Org1MSP.admin', 'Org1MSP.peer', 'Org1MSP.client')"Writers:Type: SignatureRule: "OR('Org1MSP.admin', 'Org1MSP.client')"Admins:Type: SignatureRule: "OR('Org1MSP.admin')"Endorsement:Type: SignatureRule: "OR('Org1MSP.peer')"# leave this flag set to true.AnchorPeers:# AnchorPeers defines the location of peers which can be used# for cross org gossip communication.  Note, this value is only# encoded in the genesis block in the Application section context- Host: peer0.org1.supervisor.comPort: 7051- &Org2# DefaultOrg defines the organization which is used in the sampleconfig# of the fabric.git development environmentName: Org2MSP# ID to load the MSP definition asID: Org2MSPMSPDir: crypto-config/peerOrganizations/org2.build.com/msp# Policies defines the set of policies at this level of the config tree# For organization policies, their canonical path is usually#   /Channel/<Application|Orderer>/<OrgName>/<PolicyName>Policies:Readers:Type: SignatureRule: "OR('Org2MSP.admin', 'Org2MSP.peer', 'Org2MSP.client')"Writers:Type: SignatureRule: "OR('Org2MSP.admin', 'Org2MSP.client')"Admins:Type: SignatureRule: "OR('Org2MSP.admin')"Endorsement:Type: SignatureRule: "OR('Org2MSP.peer')"AnchorPeers:# AnchorPeers defines the location of peers which can be used# for cross org gossip communication.  Note, this value is only# encoded in the genesis block in the Application section context- Host: peer0.org2.build.comPort: 9051- &Org3# DefaultOrg defines the organization which is used in the sampleconfig# of the fabric.git development environmentName: Org3MSP# ID to load the MSP definition asID: Org3MSPMSPDir: crypto-config/peerOrganizations/org3.supplier.com/msp# Policies defines the set of policies at this level of the config tree# For organization policies, their canonical path is usually#   /Channel/<Application|Orderer>/<OrgName>/<PolicyName>Policies:Readers:Type: SignatureRule: "OR('Org3MSP.admin', 'Org3MSP.peer', 'Org3MSP.client')"Writers:Type: SignatureRule: "OR('Org3MSP.admin', 'Org3MSP.client')"Admins:Type: SignatureRule: "OR('Org3MSP.admin')"Endorsement:Type: SignatureRule: "OR('Org3MSP.peer')"AnchorPeers:# AnchorPeers defines the location of peers which can be used# for cross org gossip communication.  Note, this value is only# encoded in the genesis block in the Application section context- Host: peer0.org3.supplier.comPort: 11051- &Org4# DefaultOrg defines the organization which is used in the sampleconfig# of the fabric.git development environmentName: Org4MSP# ID to load the MSP definition asID: Org4MSPMSPDir: crypto-config/peerOrganizations/org4.logistics.com/msp# Policies defines the set of policies at this level of the config tree# For organization policies, their canonical path is usually#   /Channel/<Application|Orderer>/<OrgName>/<PolicyName>Policies:Readers:Type: SignatureRule: "OR('Org4MSP.admin', 'Org4MSP.peer', 'Org4MSP.client')"Writers:Type: SignatureRule: "OR('Org4MSP.admin', 'Org4MSP.client')"Admins:Type: SignatureRule: "OR('Org4MSP.admin')"Endorsement:Type: SignatureRule: "OR('Org4MSP.peer')"AnchorPeers:# AnchorPeers defines the location of peers which can be used# for cross org gossip communication.  Note, this value is only# encoded in the genesis block in the Application section context- Host: peer0.org4.logistics.comPort: 13051################################################################################
#
#   SECTION: Capabilities
#
#   - This section defines the capabilities of fabric network. This is a new
#   concept as of v1.1.0 and should not be utilized in mixed networks with
#   v1.0.x peers and orderers.  Capabilities define features which must be
#   present in a fabric binary for that binary to safely participate in the
#   fabric network.  For instance, if a new MSP type is added, newer binaries
#   might recognize and validate the signatures from this type, while older
#   binaries without this support would be unable to validate those
#   transactions.  This could lead to different versions of the fabric binaries
#   having different world states.  Instead, defining a capability for a channel
#   informs those binaries without this capability that they must cease
#   processing transactions until they have been upgraded.  For v1.0.x if any
#   capabilities are defined (including a map with all capabilities turned off)
#   then the v1.0.x peer will deliberately crash.
#
################################################################################
Capabilities:# Channel capabilities apply to both the orderers and the peers and must be# supported by both.# Set the value of the capability to true to require it.Channel: &ChannelCapabilities# V2_0 capability ensures that orderers and peers behave according# to v2.0 channel capabilities. Orderers and peers from# prior releases would behave in an incompatible way, and are therefore# not able to participate in channels at v2.0 capability.# Prior to enabling V2.0 channel capabilities, ensure that all# orderers and peers on a channel are at v2.0.0 or later.V2_0: true# Orderer capabilities apply only to the orderers, and may be safely# used with prior release peers.# Set the value of the capability to true to require it.Orderer: &OrdererCapabilities# V2_0 orderer capability ensures that orderers behave according# to v2.0 orderer capabilities. Orderers from# prior releases would behave in an incompatible way, and are therefore# not able to participate in channels at v2.0 orderer capability.# Prior to enabling V2.0 orderer capabilities, ensure that all# orderers on channel are at v2.0.0 or later.V2_0: true# Application capabilities apply only to the peer network, and may be safely# used with prior release orderers.# Set the value of the capability to true to require it.Application: &ApplicationCapabilities# V2_0 application capability ensures that peers behave according# to v2.0 application capabilities. Peers from# prior releases would behave in an incompatible way, and are therefore# not able to participate in channels at v2.0 application capability.# Prior to enabling V2.0 application capabilities, ensure that all# peers on channel are at v2.0.0 or later.V2_0: true################################################################################
#
#   SECTION: Application
#
#   - This section defines the values to encode into a config transaction or
#   genesis block for application related parameters
#
################################################################################
Application: &ApplicationDefaults# Organizations is the list of orgs which are defined as participants on# the application side of the networkOrganizations:# Policies defines the set of policies at this level of the config tree# For Application policies, their canonical path is#   /Channel/Application/<PolicyName>Policies:Readers:Type: ImplicitMetaRule: "ANY Readers"Writers:Type: ImplicitMetaRule: "ANY Writers"Admins:Type: ImplicitMetaRule: "MAJORITY Admins"LifecycleEndorsement:Type: ImplicitMetaRule: "MAJORITY Endorsement"Endorsement:Type: ImplicitMetaRule: "MAJORITY Endorsement"Capabilities:<<: *ApplicationCapabilities
################################################################################
#
#   SECTION: Orderer
#
#   - This section defines the values to encode into a config transaction or
#   genesis block for orderer related parameters
#
################################################################################
Orderer: &OrdererDefaults# Orderer Type: The orderer implementation to startOrdererType: etcdraft# Addresses used to be the list of orderer addresses that clients and peers# could connect to.  However, this does not allow clients to associate orderer# addresses and orderer organizations which can be useful for things such# as TLS validation.  The preferred way to specify orderer addresses is now# to include the OrdererEndpoints item in your org definitionAddresses:- orderer0.example.com:7050- orderer1.example.com:8050- orderer2.example.com:9050EtcdRaft:Consenters:- Host: orderer0.example.comPort: 7050ClientTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crtServerTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt# Batch Timeout: The amount of time to wait before creating a batchBatchTimeout: 2s# Batch Size: Controls the number of messages batched into a blockBatchSize:# Max Message Count: The maximum number of messages to permit in a batchMaxMessageCount: 10# Absolute Max Bytes: The absolute maximum number of bytes allowed for# the serialized messages in a batch.AbsoluteMaxBytes: 99 MB# Preferred Max Bytes: The preferred maximum number of bytes allowed for# the serialized messages in a batch. A message larger than the preferred# max bytes will result in a batch larger than preferred max bytes.PreferredMaxBytes: 512 KB# Organizations is the list of orgs which are defined as participants on# the orderer side of the networkOrganizations:# Policies defines the set of policies at this level of the config tree# For Orderer policies, their canonical path is#   /Channel/Orderer/<PolicyName>Policies:Readers:Type: ImplicitMetaRule: "ANY Readers"Writers:Type: ImplicitMetaRule: "ANY Writers"Admins:Type: ImplicitMetaRule: "MAJORITY Admins"# BlockValidation specifies what signatures must be included in the block# from the orderer for the peer to validate it.BlockValidation:Type: ImplicitMetaRule: "ANY Writers"################################################################################
#
#   CHANNEL
#
#   This section defines the values to encode into a config transaction or
#   genesis block for channel related parameters.
#
################################################################################
Channel: &ChannelDefaults# Policies defines the set of policies at this level of the config tree# For Channel policies, their canonical path is#   /Channel/<PolicyName>Policies:# Who may invoke the 'Deliver' APIReaders:Type: ImplicitMetaRule: "ANY Readers"# Who may invoke the 'Broadcast' APIWriters:Type: ImplicitMetaRule: "ANY Writers"# By default, who may modify elements at this config levelAdmins:Type: ImplicitMetaRule: "MAJORITY Admins"# Capabilities describes the channel level capabilities, see the# dedicated Capabilities section elsewhere in this file for a full# descriptionCapabilities:<<: *ChannelCapabilities################################################################################
#
#   Profile
#
#   - Different configuration profiles may be encoded here to be specified
#   as parameters to the configtxgen tool
#
################################################################################
Profiles:FourOrgsOrdererGenesis:<<: *ChannelDefaultsOrderer:<<: *OrdererDefaultsOrdererType: etcdraftEtcdRaft:Consenters:- Host: orderer0.example.comPort: 7050ClientTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/tls/server.crtServerTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/tls/server.crt- Host: orderer1.example.comPort: 8050ClientTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/tls/server.crtServerTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/tls/server.crt- Host: orderer2.example.comPort: 9050ClientTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/server.crtServerTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/server.crtAddresses:- orderer0.example.com:7050- orderer1.example.com:8050- orderer2.example.com:9050Organizations:- *OrdererOrgCapabilities:<<: *OrdererCapabilitiesConsortiums:SampleConsortium:Organizations:- *Org1- *Org2- *Org3- *Org4FourOrgsChannel:Consortium: SampleConsortium<<: *ChannelDefaultsApplication:<<: *ApplicationDefaultsOrganizations:- *Org1- *Org2- *Org3- *Org4Capabilities:<<: *ApplicationCapabilities

configtxgen 命令参考

2)生成创世区块文件

configtxgen -profile FourOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block -channelID fabric-channel

3)生成通道文件

configtxgen -profile FourOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID mychannel

4)创建一个更新锚节点的配置更新,由于4个组织,所以本例中需要对每个组织分别调用一次

configtxgen -profile FourOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP

调用完成后,再./channel-artifacts目录下会生成如下文件

channel-artifacts/
|-- Org1MSPanchors.tx
|-- Org2MSPanchors.tx
|-- Org3MSPanchors.tx
|-- Org4MSPanchors.tx
|-- channel.tx
`-- genesis.block0 directories, 6 files

4、生成docker-compose.yaml的启动文件

docker-compose.yaml写入如下文件

version: '2.4'volumes:orderer0.example.com:orderer1.example.com:orderer2.example.com:peer0.org1.supervisor.com:peer1.org1.supervisor.com:peer0.org2.build.com:peer1.org2.build.com:peer0.org3.supplier.com:peer1.org3.supplier.com:peer0.org4.logistics.com:peer1.org4.logistics.com:networks:test:name: ordersFabric_testservices:orderer0.example.com:container_name: orderer0.example.comimage: hyperledger/fabric-orderer:latestlabels:service: hyperledger-fabricenvironment:- FABRIC_LOGGING_SPEC=INFO- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0- ORDERER_GENERAL_LISTENPORT=7050- ORDERER_GENERAL_LOCALMSPID=OrdererMSP- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp# enabled TLS- ORDERER_GENERAL_TLS_ENABLED=true- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]- ORDERER_KAFKA_TOPIC_REPLICATIONFACTOR=1- ORDERER_KAFKA_VERBOSE=true- ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/var/hyperledger/orderer/tls/server.crt- ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/var/hyperledger/orderer/tls/server.key- ORDERER_GENERAL_CLUSTER_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]- ORDERER_GENERAL_GENESISMETHOD=file- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block- ORDERER_CHANNELPARTICIPATION_ENABLED=true- ORDERER_ADMIN_TLS_ENABLED=true- ORDERER_ADMIN_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt- ORDERER_ADMIN_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key- ORDERER_ADMIN_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]- ORDERER_ADMIN_TLS_CLIENTROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]- ORDERER_ADMIN_LISTENADDRESS=0.0.0.0:7053working_dir: /opt/gopath/src/github.com/hyperledger/fabriccommand: orderervolumes:- ./channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block- ./crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/msp:/var/hyperledger/orderer/msp- ./crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/tls/:/var/hyperledger/orderer/tlsports:- 7050:7050- 7053:7053networks:- testorderer1.example.com:container_name: orderer1.example.comimage: hyperledger/fabric-orderer:latestlabels:service: hyperledger-fabricenvironment:- FABRIC_LOGGING_SPEC=INFO- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0- ORDERER_GENERAL_LISTENPORT=8050- ORDERER_GENERAL_LOCALMSPID=OrdererMSP- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp# enabled TLS- ORDERER_GENERAL_TLS_ENABLED=true- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]- ORDERER_KAFKA_TOPIC_REPLICATIONFACTOR=1- ORDERER_KAFKA_VERBOSE=true- ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/var/hyperledger/orderer/tls/server.crt- ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/var/hyperledger/orderer/tls/server.key- ORDERER_GENERAL_CLUSTER_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]- ORDERER_GENERAL_GENESISMETHOD=file- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block- ORDERER_CHANNELPARTICIPATION_ENABLED=true- ORDERER_ADMIN_TLS_ENABLED=true- ORDERER_ADMIN_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt- ORDERER_ADMIN_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key- ORDERER_ADMIN_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]- ORDERER_ADMIN_TLS_CLIENTROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]- ORDERER_ADMIN_LISTENADDRESS=0.0.0.0:7053working_dir: /opt/gopath/src/github.com/hyperledger/fabriccommand: orderervolumes:- ./channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block- ./crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/msp:/var/hyperledger/orderer/msp- ./crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/tls/:/var/hyperledger/orderer/tlsports:- 8050:8050- 7054:7053networks:- testorderer2.example.com:container_name: orderer2.example.comimage: hyperledger/fabric-orderer:latestlabels:service: hyperledger-fabricenvironment:- FABRIC_LOGGING_SPEC=INFO- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0- ORDERER_GENERAL_LISTENPORT=9050- ORDERER_GENERAL_LOCALMSPID=OrdererMSP- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp# enabled TLS- ORDERER_GENERAL_TLS_ENABLED=true- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]- ORDERER_KAFKA_TOPIC_REPLICATIONFACTOR=1- ORDERER_KAFKA_VERBOSE=true- ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/var/hyperledger/orderer/tls/server.crt- ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/var/hyperledger/orderer/tls/server.key- ORDERER_GENERAL_CLUSTER_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]- ORDERER_GENERAL_GENESISMETHOD=file- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block- ORDERER_CHANNELPARTICIPATION_ENABLED=true- ORDERER_ADMIN_TLS_ENABLED=true- ORDERER_ADMIN_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt- ORDERER_ADMIN_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key- ORDERER_ADMIN_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]- ORDERER_ADMIN_TLS_CLIENTROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]- ORDERER_ADMIN_LISTENADDRESS=0.0.0.0:7053working_dir: /opt/gopath/src/github.com/hyperledger/fabriccommand: orderervolumes:- ./channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block- ./crypto-config/ordererOrganizations/example.com/orderers/orderer2.example.com/msp:/var/hyperledger/orderer/msp- ./crypto-config/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/:/var/hyperledger/orderer/tlsports:- 9050:9050- 7055:7053networks:- testpeer0.org1.supervisor.com:container_name: peer0.org1.supervisor.comimage: hyperledger/fabric-peer:latestlabels:service: hyperledger-fabricenvironment:#Generic peer variables- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=ordersFabric_test- FABRIC_LOGGING_SPEC=INFO#- FABRIC_LOGGING_SPEC=DEBUG- CORE_PEER_TLS_ENABLED=true- CORE_PEER_PROFILE_ENABLED=true- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt# Peer specific variabes- CORE_PEER_ID=peer0.org1.supervisor.com- CORE_PEER_ADDRESS=peer0.org1.supervisor.com:7051- CORE_PEER_LISTENADDRESS=0.0.0.0:7051- CORE_PEER_CHAINCODEADDRESS=peer0.org1.supervisor.com:7052- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:7052- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org1.supervisor.com:8051- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.supervisor.com:7051- CORE_PEER_LOCALMSPID=Org1MSPvolumes:- /var/run/docker.sock:/host/var/run/docker.sock- ./crypto-config/peerOrganizations/org1.supervisor.com/peers/peer0.org1.supervisor.com/msp:/etc/hyperledger/fabric/msp- ./crypto-config/peerOrganizations/org1.supervisor.com/peers/peer0.org1.supervisor.com/tls:/etc/hyperledger/fabric/tls- /var/run/:/host/var/run/- ./:/etc/hyperledger/channel/working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peercommand: peer node startports:- 7051:7051networks:- testpeer1.org1.supervisor.com:container_name: peer1.org1.supervisor.comimage: hyperledger/fabric-peer:latestlabels:service: hyperledger-fabricenvironment:#Generic peer variables- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=ordersFabric_test- FABRIC_LOGGING_SPEC=INFO#- FABRIC_LOGGING_SPEC=DEBUG- CORE_PEER_TLS_ENABLED=true- CORE_PEER_PROFILE_ENABLED=true- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt# Peer specific variabes- CORE_PEER_ID=peer1.org1.supervisor.com- CORE_PEER_ADDRESS=peer1.org1.supervisor.com:8051- CORE_PEER_LISTENADDRESS=0.0.0.0:8051- CORE_PEER_CHAINCODEADDRESS=peer1.org1.supervisor.com:8052- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:8052- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.supervisor.com:7051- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.supervisor.com:8051- CORE_PEER_LOCALMSPID=Org1MSPvolumes:- /var/run/docker.sock:/host/var/run/docker.sock- ./crypto-config/peerOrganizations/org1.supervisor.com/peers/peer1.org1.supervisor.com/msp:/etc/hyperledger/fabric/msp- ./crypto-config/peerOrganizations/org1.supervisor.com/peers/peer1.org1.supervisor.com/tls:/etc/hyperledger/fabric/tls- /var/run/:/host/var/run/- ./:/etc/hyperledger/channel/working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peercommand: peer node startports:- 8051:8051networks:- testpeer0.org2.build.com:container_name: peer0.org2.build.comimage: hyperledger/fabric-peer:latestlabels:service: hyperledger-fabricenvironment:#Generic peer variables- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=ordersFabric_test- FABRIC_LOGGING_SPEC=INFO#- FABRIC_LOGGING_SPEC=DEBUG- CORE_PEER_TLS_ENABLED=true- CORE_PEER_PROFILE_ENABLED=true- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt# Peer specific variabes- CORE_PEER_ID=peer0.org2.build.com- CORE_PEER_ADDRESS=peer0.org2.build.com:9051- CORE_PEER_LISTENADDRESS=0.0.0.0:9051- CORE_PEER_CHAINCODEADDRESS=peer0.org2.build.com:9052- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:9052- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org2.build.com:10051- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.build.com:9051- CORE_PEER_LOCALMSPID=Org2MSPvolumes:- /var/run/docker.sock:/host/var/run/docker.sock- ./crypto-config/peerOrganizations/org2.build.com/peers/peer0.org2.build.com/msp:/etc/hyperledger/fabric/msp- ./crypto-config/peerOrganizations/org2.build.com/peers/peer0.org2.build.com/tls:/etc/hyperledger/fabric/tls- /var/run/:/host/var/run/- ./:/etc/hyperledger/channel/working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peercommand: peer node startports:- 9051:9051networks:- testpeer1.org2.build.com:container_name: peer1.org2.build.comimage: hyperledger/fabric-peer:latestlabels:service: hyperledger-fabricenvironment:#Generic peer variables- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=ordersFabric_test- FABRIC_LOGGING_SPEC=INFO#- FABRIC_LOGGING_SPEC=DEBUG- CORE_PEER_TLS_ENABLED=true- CORE_PEER_PROFILE_ENABLED=true- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt# Peer specific variabes- CORE_PEER_ID=peer1.org2.build.com- CORE_PEER_ADDRESS=peer1.org2.build.com:10051- CORE_PEER_LISTENADDRESS=0.0.0.0:10051- CORE_PEER_CHAINCODEADDRESS=peer1.org2.build.com:10052- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:10052- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.build.com:9051- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org2.build.com:10051- CORE_PEER_LOCALMSPID=Org2MSPvolumes:- /var/run/docker.sock:/host/var/run/docker.sock- ./crypto-config/peerOrganizations/org2.build.com/peers/peer1.org2.build.com/msp:/etc/hyperledger/fabric/msp- ./crypto-config/peerOrganizations/org2.build.com/peers/peer1.org2.build.com/tls:/etc/hyperledger/fabric/tls- /var/run/:/host/var/run/- ./:/etc/hyperledger/channel/working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peercommand: peer node startports:- 10051:10051networks:- testpeer0.org3.supplier.com:container_name: peer0.org3.supplier.comimage: hyperledger/fabric-peer:latestlabels:service: hyperledger-fabricenvironment:#Generic peer variables- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=ordersFabric_test- FABRIC_LOGGING_SPEC=INFO#- FABRIC_LOGGING_SPEC=DEBUG- CORE_PEER_TLS_ENABLED=true- CORE_PEER_PROFILE_ENABLED=true- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt# Peer specific variabes- CORE_PEER_ID=peer0.org3.supplier.com- CORE_PEER_ADDRESS=peer0.org3.supplier.com:11051- CORE_PEER_LISTENADDRESS=0.0.0.0:11051- CORE_PEER_CHAINCODEADDRESS=peer0.org3.supplier.com:11052- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:11052- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org3.supplier.com:12051- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org3.supplier.com:11051- CORE_PEER_LOCALMSPID=Org3MSPvolumes:- /var/run/docker.sock:/host/var/run/docker.sock- ./crypto-config/peerOrganizations/org3.supplier.com/peers/peer0.org3.supplier.com/msp:/etc/hyperledger/fabric/msp- ./crypto-config/peerOrganizations/org3.supplier.com/peers/peer0.org3.supplier.com/tls:/etc/hyperledger/fabric/tls- /var/run/:/host/var/run/- ./:/etc/hyperledger/channel/working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peercommand: peer node startports:- 11051:11051networks:- testpeer1.org3.supplier.com:container_name: peer1.org3.supplier.comimage: hyperledger/fabric-peer:latestlabels:service: hyperledger-fabricenvironment:#Generic peer variables- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=ordersFabric_test- FABRIC_LOGGING_SPEC=INFO#- FABRIC_LOGGING_SPEC=DEBUG- CORE_PEER_TLS_ENABLED=true- CORE_PEER_PROFILE_ENABLED=true- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt# Peer specific variabes- CORE_PEER_ID=peer1.org3.supplier.com- CORE_PEER_ADDRESS=peer1.org3.supplier.com:12051- CORE_PEER_LISTENADDRESS=0.0.0.0:12051- CORE_PEER_CHAINCODEADDRESS=peer1.org3.supplier.com:12052- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:12052- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org3.supplier.com:11051- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org3.supplier.com:12051- CORE_PEER_LOCALMSPID=Org3MSPvolumes:- /var/run/docker.sock:/host/var/run/docker.sock- ./crypto-config/peerOrganizations/org3.supplier.com/peers/peer1.org3.supplier.com/msp:/etc/hyperledger/fabric/msp- ./crypto-config/peerOrganizations/org3.supplier.com/peers/peer1.org3.supplier.com/tls:/etc/hyperledger/fabric/tls- /var/run/:/host/var/run/- ./:/etc/hyperledger/channel/working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peercommand: peer node startports:- 12051:12051networks:- testpeer0.org4.logistics.com:container_name: peer0.org4.logistics.comimage: hyperledger/fabric-peer:latestlabels:service: hyperledger-fabricenvironment:#Generic peer variables- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=ordersFabric_test- FABRIC_LOGGING_SPEC=INFO#- FABRIC_LOGGING_SPEC=DEBUG- CORE_PEER_TLS_ENABLED=true- CORE_PEER_PROFILE_ENABLED=true- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt# Peer specific variabes- CORE_PEER_ID=peer0.org4.logistics.com- CORE_PEER_ADDRESS=peer0.org4.logistics.com:13051- CORE_PEER_LISTENADDRESS=0.0.0.0:13051- CORE_PEER_CHAINCODEADDRESS=peer0.org4.logistics.com:13052- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:13052- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org4.logistics.com:14051- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org4.logistics.com:13051- CORE_PEER_LOCALMSPID=Org4MSPvolumes:- /var/run/docker.sock:/host/var/run/docker.sock- ./crypto-config/peerOrganizations/org4.logistics.com/peers/peer0.org4.logistics.com/msp:/etc/hyperledger/fabric/msp- ./crypto-config/peerOrganizations/org4.logistics.com/peers/peer0.org4.logistics.com/tls:/etc/hyperledger/fabric/tls- /var/run/:/host/var/run/- ./:/etc/hyperledger/channel/working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peercommand: peer node startports:- 13051:13051networks:- testpeer1.org4.logistics.com:container_name: peer1.org4.logistics.comimage: hyperledger/fabric-peer:latestlabels:service: hyperledger-fabricenvironment:#Generic peer variables- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=ordersFabric_test- FABRIC_LOGGING_SPEC=INFO#- FABRIC_LOGGING_SPEC=DEBUG- CORE_PEER_TLS_ENABLED=true- CORE_PEER_PROFILE_ENABLED=true- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt# Peer specific variabes- CORE_PEER_ID=peer1.org4.logistics.com- CORE_PEER_ADDRESS=peer1.org4.logistics.com:14051- CORE_PEER_LISTENADDRESS=0.0.0.0:14051- CORE_PEER_CHAINCODEADDRESS=peer1.org4.logistics.com:14052- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:14052- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org4.logistics.com:13051- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org4.logistics.com:14051- CORE_PEER_LOCALMSPID=Org4MSPvolumes:- /var/run/docker.sock:/host/var/run/docker.sock- ./crypto-config/peerOrganizations/org4.logistics.com/peers/peer1.org4.logistics.com/msp:/etc/hyperledger/fabric/msp- ./crypto-config/peerOrganizations/org4.logistics.com/peers/peer1.org4.logistics.com/tls:/etc/hyperledger/fabric/tls- /var/run/:/host/var/run/- ./:/etc/hyperledger/channel/working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peercommand: peer node startports:- 14051:14051networks:- testcli1:container_name: cli1image: hyperledger/fabric-tools:latesttty: truestdin_open: trueenvironment:- GOPATH=/opt/gopath- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock- FABRIC_LOGGING_SPEC=INFO- CORE_PEER_ID=cli1- CORE_PEER_ADDRESS=peer0.org1.supervisor.com:7051- CORE_PEER_LOCALMSPID=Org1MSP- CORE_PEER_TLS_ENABLED=true- CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.supervisor.com/peers/peer0.org1.supervisor.com/tls/server.crt- CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.supervisor.com/peers/peer0.org1.supervisor.com/tls/server.key- CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.supervisor.com/peers/peer0.org1.supervisor.com/tls/ca.crt- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.supervisor.com/users/Admin@org1.supervisor.com/mspworking_dir: /opt/gopath/src/github.com/hyperledger/fabric/peercommand: /bin/bashvolumes:- /var/run/:/host/var/run/- ./chaincode/go/:/opt/gopath/src/github.com/hyperledger/fabric-cluster/chaincode/go- ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/- ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifactsnetworks:- testcli2:container_name: cli2image: hyperledger/fabric-tools:latesttty: truestdin_open: trueenvironment:- GOPATH=/opt/gopath- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock- FABRIC_LOGGING_SPEC=INFO- CORE_PEER_ID=cli2- CORE_PEER_ADDRESS=peer0.org2.build.com:9051- CORE_PEER_LOCALMSPID=Org2MSP- CORE_PEER_TLS_ENABLED=true- CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.build.com/peers/peer0.org2.build.com/tls/server.crt- CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.build.com/peers/peer0.org2.build.com/tls/server.key- CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.build.com/peers/peer0.org2.build.com/tls/ca.crt- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.build.com/users/Admin@org2.build.com/mspworking_dir: /opt/gopath/src/github.com/hyperledger/fabric/peercommand: /bin/bashvolumes:- /var/run/:/host/var/run/- ./chaincode/go/:/opt/gopath/src/github.com/hyperledger/fabric-cluster/chaincode/go- ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/- ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifactsnetworks:- testcli3:container_name: cli3image: hyperledger/fabric-tools:latesttty: truestdin_open: trueenvironment:- GOPATH=/opt/gopath- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock- FABRIC_LOGGING_SPEC=INFO- CORE_PEER_ID=cli3- CORE_PEER_ADDRESS=peer0.org3.supplier.com:11051- CORE_PEER_LOCALMSPID=Org3MSP- CORE_PEER_TLS_ENABLED=true- CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.supplier.com/peers/peer0.org3.supplier.com/tls/server.crt- CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.supplier.com/peers/peer0.org3.supplier.com/tls/server.key- CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.supplier.com/peers/peer0.org3.supplier.com/tls/ca.crt- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.supplier.com/users/Admin@org3.supplier.com/mspworking_dir: /opt/gopath/src/github.com/hyperledger/fabric/peercommand: /bin/bashvolumes:- /var/run/:/host/var/run/- ./chaincode/go/:/opt/gopath/src/github.com/hyperledger/fabric-cluster/chaincode/go- ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/- ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifactsnetworks:- testcli4:container_name: cli4image: hyperledger/fabric-tools:latesttty: truestdin_open: trueenvironment:- GOPATH=/opt/gopath- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock- FABRIC_LOGGING_SPEC=INFO- CORE_PEER_ID=cli4- CORE_PEER_ADDRESS=peer0.org4.logistics.com:13051- CORE_PEER_LOCALMSPID=Org4MSP- CORE_PEER_TLS_ENABLED=true- CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org4.logistics.com/peers/peer0.org4.logistics.com/tls/server.crt- CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org4.logistics.com/peers/peer0.org4.logistics.com/tls/server.key- CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org4.logistics.com/peers/peer0.org4.logistics.com/tls/ca.crt- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org4.logistics.com/users/Admin@org4.logistics.com/mspworking_dir: /opt/gopath/src/github.com/hyperledger/fabric/peercommand: /bin/bashvolumes:- /var/run/:/host/var/run/- ./chaincode/go/:/opt/gopath/src/github.com/hyperledger/fabric-cluster/chaincode/go- ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/- ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifactsnetworks:- test

在当前的目录下调用

docker-compose up -d

会启动网络,输入如下指令可以查看状态

docker ps -a

启动后,可以发现docker中的状态为UP说明成功启动了fabric网络

5、通道相关配置操作

1)创建通道,生成通道文件

peer channel create -o orderer0.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/msp/tlscacerts/tlsca.example.com-cert.pem

2)将通道文件复制到项目路径下,复制到容器内,方便加入通道

docker cp cli1:/opt/gopath/src/github.com/hyperledger/fabric/peer/mychannel.block ./
docker cp mychannel.block cli2:/opt/gopath/src/github.com/hyperledger/fabric/peer
docker cp mychannel.block cli3:/opt/gopath/src/github.com/hyperledger/fabric/peer
docker cp mychannel.block cli4:/opt/gopath/src/github.com/hyperledger/fabric/peer

3)加入通道

docker exec -it cli1/2/3/4 bash进入,且四个终端中都输入如下,加入通道

peer channel join -b mychannel.block

4)更新锚节点文件

peer channel update -o orderer0.example.com:7050 -c mychannel -f ./channel-artifacts/Org1MSPanchors.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
peer channel update -o orderer0.example.com:7050 -c mychannel -f ./channel-artifacts/Org2MSPanchors.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
peer channel update -o orderer0.example.com:7050 -c mychannel -f ./channel-artifacts/Org3MSPanchors.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
peer channel update -o orderer0.example.com:7050 -c mychannel -f ./channel-artifacts/Org4MSPanchors.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

6、链码调用

1)复制链码文件
在fabric-samples/chaincode/sacc/go/文件夹下复制sacc.go到当前工作目录的./chaincode/go/ 下
2)打包链码

进入docker中的链码目录

cd /opt/gopath/src/github.com/hyperledger/fabric-cluster/chaincode/go

配置go

go env -w GOPROXY=https://goproxy.cn,direct
go mod init
go mod vendor

返回工作目录

cd /opt/gopath/src/github.com/hyperledger/fabric/peer

打包链码

peer lifecycle chaincode package sacc.tar.gz \--path github.com/hyperledger/fabric-cluster/chaincode/go/ \--label sacc_1

3)安装链码
在每个docker的cli1/2/3/4中

peer lifecycle chaincode install sacc.tar.gz

4)授权同意链码

peer lifecycle chaincode approveformyorg --channelID mychannel --name sacc --version 1.0 --init-required --package-id  --sequence 1 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

查看链码的授权状态

peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name sacc --version 1.0 --init-required --sequence 1 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --output json

5)commit 链码

peer lifecycle chaincode commit -o orderer0.example.com:7050 --channelID mychannel --name sacc --version 1.0 --sequence 1 --init-required --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --peerAddresses peer0.org1.supervisor.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.supervisor.com/peers/peer0.org1.supervisor.com/tls/ca.crt --peerAddresses peer0.org2.build.com:9051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.build.com/peers/peer0.org2.build.com/tls/ca.crt --peerAddresses peer0.org3.supplier.com:11051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.supplier.com/peers/peer0.org3.supplier.com/tls/ca.crt --peerAddresses peer0.org4.logistics.com:13051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org4.logistics.com/peers/peer0.org4.logistics.com/tls/ca.crt

6)初始化链码

peer chaincode invoke -o orderer0.example.com:7050 --isInit --ordererTLSHostnameOverride orderer0.example.com --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n sacc --peerAddresses peer0.org1.supervisor.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.supervisor.com/peers/peer0.org1.supervisor.com/tls/ca.crt --peerAddresses peer0.org2.build.com:9051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.build.com/peers/peer0.org2.build.com/tls/ca.crt --peerAddresses peer0.org3.supplier.com:11051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.supplier.com/peers/peer0.org3.supplier.com/tls/ca.crt --peerAddresses peer0.org4.logistics.com:13051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org4.logistics.com/peers/peer0.org4.logistics.com/tls/ca.crt -c '{"Args":["a","bb"]}'

7)查询链码

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

8)调用链码

peer chaincode invoke -o orderer0.example.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n sacc --peerAddresses peer0.org1.supervisor.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.supervisor.com/peers/peer0.org1.supervisor.com/tls/ca.crt --peerAddresses peer0.org2.build.com:9051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.build.com/peers/peer0.org2.build.com/tls/ca.crt --peerAddresses peer0.org3.supplier.com:11051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.supplier.com/peers/peer0.org3.supplier.com/tls/ca.crt --peerAddresses peer0.org4.logistics.com:13051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org4.logistics.com/peers/peer0.org4.logistics.com/tls/ca.crt -c '{"Args":["set","a","cc"]}'

9)再次查询链码

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

完结

Hyperledger Fabric 2.x 单机部署多节点网络相关推荐

  1. (一)Hyperledger Fabric 1.1安装部署-基础环境搭建

    在学习和开发hyperledger fabric的时候遇到了一些坑,现将自己的一些总结和心得整理如下,以期对大家有所帮助. 本次使用的宿主机环境:ubuntu,版本:Ubuntu 16.04.3 LT ...

  2. Hyperledger Fabric(构建你的第一个网络)

    构建你的第一个网络 这些说明已经过验证,可以与最新的稳定Docker镜像和提供的tar文件中预编译的安装实用程序一起工作,如果使用当前主分支中的镜像或工具运行这些命令,则可能会看到配置和紧急错误. 构 ...

  3. Hyperledger Fabric学习笔记(三)- 启动网络并测试一个Fabcar的demo

    参考文章:https://blog.csdn.net/jambeau/article/details/107551208 前言:文章底下的$GOPATH即为~/go,也就是当前用户下的go目录,比如我 ...

  4. Hyperledger Fabric SDK Go构建第一个应用

    写在前面: 本文内容翻译自:https://chainhero.io/2018/03/tutorial-build-blockchain-app-2/ ,文档中的命令操作均在实际环境进行验证,现将成果 ...

  5. “Hyperledger Fabric 是假区块链!”

    作者 | Stuart Popejoy 编译 | 王国玺 出品 | 区块链大本营(blockchain_camp) 自 Libra 发布以来,沉寂已久的区块链社区又活跃了起来,一些探索区块链业务的公司 ...

  6. 在一台Ubuntu计算机上构建Hyperledger Fabric网络

    在一台Ubuntu计算机上构建Hyperledger Fabric网络 Hyperledger fabric是一个开源的区块链应用程序平台,为开发基于区块链的应用程序提供了一个起点.当我们提到Hype ...

  7. (Fabric 超级账本学习【5】)Fabric2.4网络环境下——搭建Hyperledger Fabric区块链浏览器

    博主最近在搭建Hyperledger Fabric区块链浏览器过程中也学习了很多博主的搭建流程,踩了很多雷,踩 了很多坑,现将成功搭建好的Hyperledger Fabric区块链浏览器详细流程分享如 ...

  8. Hyperledger Fabric V1.0– 开发者快速入门

    Hyperledger Fabric V1.0– 开发者快速入门 本文档演示使用Hyperledger Fabric V1.0来部署一个开发者环境并运行一个简单例子.文档包括创建和加入通道(账本).客 ...

  9. 手把手教你走进Hyperledger Fabric

    现在,Blockchain是业内新的热门话题.但是,寻找良好的资源来学习这项引人入胜的技术并不是一件容易的事.为了让其他人更容易学习,我开始在区块链和分布式分类帐技术(DLT)平台领域开展一系列工作. ...

最新文章

  1. TF.VARIABLE和TENSOR的区别(转)
  2. (转) Android生成签名文件并用其对apk文件进行签名
  3. varnish---反向代理web加速缓存服务器和CDN的推送
  4. ZOJ3785 What day is that day? 快速幂+找规律
  5. 关于window对象
  6. Pagination(分页) 从前台到后端总结
  7. 关于django的模板
  8. ROS学习笔记八:创建ROS msg和srv
  9. 增强for循环 泛型
  10. vue之elementui表单验证最基本实例
  11. matlab找不到vs编译器
  12. J2ME基本术语词典(05/06/09)
  13. GANDCRAB V5.2勒索病毒,不可破解,尽快防御!
  14. 《软件开发》串口调试助手
  15. 将字符串中的大写字母转换为小写字母
  16. 「 程序员的风险控制」意外险:花几十块就能让你不用担心明天和意外哪个先来
  17. 2020 前端必看 20个最好的前端Web开发工具
  18. 大数据开发学习:进行大数据开发课程有哪些
  19. Scratch教程——完整的跳跃
  20. 《金字塔原理》读书思维导图

热门文章

  1. dede flag php,织梦dede:list按flag属性调用文档
  2. 英语----倒装句(上):完全倒装
  3. 基础算法 - 冒泡排序
  4. 秦皇岛 2019 CCPC区域赛 部分代码
  5. mallox勒索病毒数据恢复|金蝶、用友、管家婆、OA、速达、ERP等软件数据库恢复
  6. “啤酒与尿布”--零售业的购物篮分析包含了哪些数据挖掘算法?
  7. 腊是壹家剧本杀——5人本(后期会更新)
  8. opencv 压缩程序格式解析
  9. 项目服务器费用如何分摊合理,企业开发有多个项目发生的管理费用如何分摊
  10. 8/21 牛客补题+cf思维+tarjan