-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix test-network to work with BFT consensus.
Added a new option for creating channel: Running ./network.sh createChannel -bft will initiate a channel running BFT orderers. Using ./network.sh up -bft will initiate dockers for bft environment. Added option for 4 orderers. Signed-off-by: Arkadi Piven <arkadi.piven@ibm.com> Signed-off-by: arkadipiven <arkadi7770@gmail.com>
- Loading branch information
1 parent
f8f52ca
commit 7519e1d
Showing
14 changed files
with
653 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,287 @@ | ||
version: '3.7' | ||
|
||
volumes: | ||
orderer.example.com: | ||
orderer2.example.com: | ||
orderer3.example.com: | ||
orderer4.example.com: | ||
peer0.org1.example.com: | ||
peer0.org2.example.com: | ||
|
||
networks: | ||
test: | ||
name: fabric_test | ||
|
||
services: | ||
|
||
orderer.example.com: | ||
container_name: orderer.example.com | ||
image: hyperledger/fabric-orderer:latest | ||
labels: | ||
service: hyperledger-fabric | ||
environment: | ||
- 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_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_BOOTSTRAPMETHOD=none | ||
- 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:7053 | ||
- ORDERER_OPERATIONS_LISTENADDRESS=orderer.example.com:9443 | ||
- ORDERER_METRICS_PROVIDER=prometheus | ||
working_dir: /root | ||
command: orderer | ||
volumes: | ||
- ../organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp | ||
- ../organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls | ||
- orderer.example.com:/var/hyperledger/production/orderer | ||
ports: | ||
- 7050:7050 | ||
- 7053:7053 | ||
- 9443:9443 | ||
networks: | ||
- test | ||
|
||
orderer2.example.com: | ||
container_name: orderer2.example.com | ||
image: hyperledger/fabric-orderer:latest | ||
labels: | ||
service: hyperledger-fabric | ||
environment: | ||
- FABRIC_LOGGING_SPEC=INFO | ||
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 | ||
- ORDERER_GENERAL_LISTENPORT=7052 | ||
- 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_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_BOOTSTRAPMETHOD=none | ||
- 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:7055 | ||
- ORDERER_OPERATIONS_LISTENADDRESS=orderer2.example.com:9446 | ||
- ORDERER_METRICS_PROVIDER=prometheus | ||
working_dir: /root | ||
command: orderer | ||
volumes: | ||
- ../organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/msp:/var/hyperledger/orderer/msp | ||
- ../organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/:/var/hyperledger/orderer/tls | ||
- orderer2.example.com:/var/hyperledger/production/orderer | ||
ports: | ||
- 7052:7052 | ||
- 7055:7055 | ||
- 9446:9446 | ||
networks: | ||
- test | ||
|
||
orderer3.example.com: | ||
container_name: orderer3.example.com | ||
image: hyperledger/fabric-orderer:latest | ||
labels: | ||
service: hyperledger-fabric | ||
environment: | ||
- FABRIC_LOGGING_SPEC=INFO | ||
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 | ||
- ORDERER_GENERAL_LISTENPORT=7056 | ||
- 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_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_BOOTSTRAPMETHOD=none | ||
- 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:7057 | ||
- ORDERER_OPERATIONS_LISTENADDRESS=orderer3.example.com:9447 | ||
- ORDERER_METRICS_PROVIDER=prometheus | ||
working_dir: /root | ||
command: orderer | ||
volumes: | ||
- ../organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/msp:/var/hyperledger/orderer/msp | ||
- ../organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/:/var/hyperledger/orderer/tls | ||
- orderer3.example.com:/var/hyperledger/production/orderer | ||
ports: | ||
- 7056:7056 | ||
- 7057:7057 | ||
- 9447:9447 | ||
networks: | ||
- test | ||
|
||
orderer4.example.com: | ||
container_name: orderer4.example.com | ||
image: hyperledger/fabric-orderer:latest | ||
labels: | ||
service: hyperledger-fabric | ||
environment: | ||
- FABRIC_LOGGING_SPEC=INFO | ||
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 | ||
- ORDERER_GENERAL_LISTENPORT=7058 | ||
- 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_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_BOOTSTRAPMETHOD=none | ||
- 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:7059 | ||
- ORDERER_OPERATIONS_LISTENADDRESS=orderer4.example.com:9448 | ||
- ORDERER_METRICS_PROVIDER=prometheus | ||
working_dir: /root | ||
command: orderer | ||
volumes: | ||
- ../organizations/ordererOrganizations/example.com/orderers/orderer4.example.com/msp:/var/hyperledger/orderer/msp | ||
- ../organizations/ordererOrganizations/example.com/orderers/orderer4.example.com/tls/:/var/hyperledger/orderer/tls | ||
- orderer4.example.com:/var/hyperledger/production/orderer | ||
ports: | ||
- 7058:7058 | ||
- 7059:7059 | ||
- 9448:9448 | ||
networks: | ||
- test | ||
|
||
|
||
|
||
|
||
peer0.org1.example.com: | ||
container_name: peer0.org1.example.com | ||
image: hyperledger/fabric-peer:latest | ||
labels: | ||
service: hyperledger-fabric | ||
environment: | ||
- FABRIC_CFG_PATH=/etc/hyperledger/peercfg | ||
- FABRIC_LOGGING_SPEC=INFO | ||
#- FABRIC_LOGGING_SPEC=DEBUG | ||
- CORE_PEER_TLS_ENABLED=true | ||
- CORE_PEER_PROFILE_ENABLED=false | ||
- 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 variables | ||
- CORE_PEER_ID=peer0.org1.example.com | ||
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051 | ||
- CORE_PEER_LISTENADDRESS=0.0.0.0:7051 | ||
- CORE_PEER_CHAINCODEADDRESS=peer0.org1.example.com:7052 | ||
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:7052 | ||
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051 | ||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051 | ||
- CORE_PEER_LOCALMSPID=Org1MSP | ||
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp | ||
- CORE_OPERATIONS_LISTENADDRESS=peer0.org1.example.com:9444 | ||
- CORE_METRICS_PROVIDER=prometheus | ||
- CHAINCODE_AS_A_SERVICE_BUILDER_CONFIG={"peername":"peer0org1"} | ||
- CORE_CHAINCODE_EXECUTETIMEOUT=300s | ||
volumes: | ||
- ../organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com:/etc/hyperledger/fabric | ||
- peer0.org1.example.com:/var/hyperledger/production | ||
working_dir: /root | ||
command: peer node start | ||
ports: | ||
- 7051:7051 | ||
- 9444:9444 | ||
networks: | ||
- test | ||
|
||
peer0.org2.example.com: | ||
container_name: peer0.org2.example.com | ||
image: hyperledger/fabric-peer:latest | ||
labels: | ||
service: hyperledger-fabric | ||
environment: | ||
- FABRIC_CFG_PATH=/etc/hyperledger/peercfg | ||
- FABRIC_LOGGING_SPEC=INFO | ||
#- FABRIC_LOGGING_SPEC=DEBUG | ||
- CORE_PEER_TLS_ENABLED=true | ||
- CORE_PEER_PROFILE_ENABLED=false | ||
- 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 variables | ||
- CORE_PEER_ID=peer0.org2.example.com | ||
- CORE_PEER_ADDRESS=peer0.org2.example.com:9051 | ||
- CORE_PEER_LISTENADDRESS=0.0.0.0:9051 | ||
- CORE_PEER_CHAINCODEADDRESS=peer0.org2.example.com:9052 | ||
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:9052 | ||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:9051 | ||
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:9051 | ||
- CORE_PEER_LOCALMSPID=Org2MSP | ||
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp | ||
- CORE_OPERATIONS_LISTENADDRESS=peer0.org2.example.com:9445 | ||
- CORE_METRICS_PROVIDER=prometheus | ||
- CHAINCODE_AS_A_SERVICE_BUILDER_CONFIG={"peername":"peer0org2"} | ||
- CORE_CHAINCODE_EXECUTETIMEOUT=300s | ||
volumes: | ||
- ../organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com:/etc/hyperledger/fabric | ||
- peer0.org2.example.com:/var/hyperledger/production | ||
working_dir: /root | ||
command: peer node start | ||
ports: | ||
- 9051:9051 | ||
- 9445:9445 | ||
networks: | ||
- test | ||
|
||
cli: | ||
container_name: cli | ||
image: hyperledger/fabric-tools:latest | ||
labels: | ||
service: hyperledger-fabric | ||
tty: true | ||
stdin_open: true | ||
environment: | ||
- GOPATH=/opt/gopath | ||
- FABRIC_LOGGING_SPEC=INFO | ||
- FABRIC_CFG_PATH=/etc/hyperledger/peercfg | ||
#- FABRIC_LOGGING_SPEC=DEBUG | ||
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer | ||
command: /bin/bash | ||
volumes: | ||
- ../organizations:/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations | ||
- ../scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/ | ||
depends_on: | ||
- peer0.org1.example.com | ||
- peer0.org2.example.com | ||
networks: | ||
- test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
test-network/compose/docker/docker-compose-bft-test-net.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright IBM Corp. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
version: '3.7' | ||
services: | ||
peer0.org1.example.com: | ||
container_name: peer0.org1.example.com | ||
image: hyperledger/fabric-peer:latest | ||
labels: | ||
service: hyperledger-fabric | ||
environment: | ||
#Generic peer variables | ||
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock | ||
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=fabric_test | ||
volumes: | ||
- ./docker/peercfg:/etc/hyperledger/peercfg | ||
- ${DOCKER_SOCK}:/host/var/run/docker.sock | ||
|
||
peer0.org2.example.com: | ||
container_name: peer0.org2.example.com | ||
image: hyperledger/fabric-peer:latest | ||
labels: | ||
service: hyperledger-fabric | ||
environment: | ||
#Generic peer variables | ||
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock | ||
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=fabric_test | ||
volumes: | ||
- ./docker/peercfg:/etc/hyperledger/peercfg | ||
- ${DOCKER_SOCK}:/host/var/run/docker.sock | ||
|
||
cli: | ||
container_name: cli | ||
image: hyperledger/fabric-tools:latest | ||
volumes: | ||
- ./docker/peercfg:/etc/hyperledger/peercfg |
Oops, something went wrong.