docker-compose-files/hyperledger_fabric/v2.2.1/base-raft.yaml

230 lines
9.7 KiB
YAML

# All elements in this file should depend on the base.yaml
# Provided a Kafka enabled fabric network with:
# ca.org1.example.com
# ca.org2.example.com
# orderer0.example.com
# orderer1.example.com
# peer0.org1.example.com
# peer1.org1.example.com
# peer0.org2.example.com
# peer1.org2.example.com
# 3 zookeeper nodes
# 4 raft nodes
# cli
version: '2' # v3 does not support 'extends' yet
services:
ca.org1.example.com:
extends:
file: base.yaml
service: ca-base
container_name: ca.org1.example.com
hostname: ca.org1.example.com
environment:
- FABRIC_CA_SERVER_CA_NAME=ca-org1
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/c843d3f021118963ce5d340e95286e8869bb7bd051454cd4166aa2887a2ad451_sk
ports:
- "7054:7054"
volumes:
- ./crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/c843d3f021118963ce5d340e95286e8869bb7bd051454cd4166aa2887a2ad451_sk -b admin:adminpw -d'
ca.org2.example.com:
extends:
file: base.yaml
service: ca-base
container_name: ca.org2.example.com
hostname: ca.org2.example.com
environment:
- FABRIC_CA_SERVER_CA_NAME=ca-org2
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/1ee551a8753171c0377366e96a1d7ec01afddb868c9483cc501b6f8ac7ae752f_sk
ports:
- "8054:7054"
volumes:
- ./crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/1ee551a8753171c0377366e96a1d7ec01afddb868c9483cc501b6f8ac7ae752f_sk -b admin:adminpw -d'
orderer0.example.com: # There can be multiple orderers
extends:
file: base.yaml
service: orderer-base
container_name: orderer0.example.com
hostname: orderer0.example.com
ports:
- "7050:7050"
environment:
- FABRIC_LOGGING_SPEC=DEBUG
- ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/etc/hyperledger/fabric/tls/server.key
- ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/etc/hyperledger/fabric/tls/server.crt
- ORDERER_GENERAL_CLUSTER_ROOTCAS=[/etc/hyperledger/fabric/tls/ca.crt]
# below 4 must be defined/undefined together, for using separate network for raft
#- ORDERER_GENERAL_CLUSTER_LISTENADDRESS=0.0.0.0
#- ORDERER_GENERAL_CLUSTER_LISTENPORT=7050 # this must be the same with channel config
#- ORDERER_GENERAL_CLUSTER_SERVERCERTIFICATE=/etc/hyperledger/fabric/tls/server.crt
#- ORDERER_GENERAL_CLUSTER_SERVERPRIVATEKEY=/etc/hyperledger/fabric/tls/server.key
volumes:
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/tls/:/etc/hyperledger/fabric/tls
- ./raft/channel-artifacts/orderer0.genesis.block:/etc/hyperledger/fabric/orderer.genesis.block
command: orderer start
orderer1.example.com: # There can be multiple orderers
extends:
file: base.yaml
service: orderer-base
container_name: orderer1.example.com
hostname: orderer1.example.com
ports:
- "8050:7050"
environment:
- ORDERER_GENERAL_CLUSTER_SENDBUFFERSIZE=10
volumes:
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/tls/:/etc/hyperledger/fabric/tls
- ./raft/channel-artifacts/orderer1.genesis.block:/etc/hyperledger/fabric/orderer.genesis.block
command: orderer start
orderer2.example.com: # There can be multiple orderers
extends:
file: base.yaml
service: orderer-base
container_name: orderer2.example.com
hostname: orderer2.example.com
ports:
- "9050:7050"
environment:
- ORDERER_GENERAL_CLUSTER_SENDBUFFERSIZE=10
volumes:
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer2.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/:/etc/hyperledger/fabric/tls
- ./raft/channel-artifacts/orderer2.genesis.block:/etc/hyperledger/fabric/orderer.genesis.block
command: orderer start
## following are peer nodes ##
peer0.org1.example.com:
extends:
file: base.yaml
service: peer-base
container_name: peer0.org1.example.com
hostname: peer0.org1.example.com
environment:
- CORE_PEER_ID=peer0.org1.example.com
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org1.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
- FABRIC_LOGGING_SPEC=DEBUG # info:core.chaincode=debug
volumes:
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls
ports:
- 7051:7051
peer1.org1.example.com:
extends:
file: base.yaml
service: peer-base
container_name: peer1.org1.example.com
hostname: peer1.org1.example.com
environment:
- CORE_PEER_ID=peer1.org1.example.com
- CORE_PEER_ADDRESS=peer1.org1.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer1.org1.example.com:7052
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
volumes:
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls:/etc/hyperledger/fabric/tls
ports:
- 8051:7051
peer0.org2.example.com:
extends:
file: base.yaml
service: peer-base
container_name: peer0.org2.example.com
hostname: peer0.org2.example.com
environment:
- CORE_PEER_ID=peer0.org2.example.com
- CORE_PEER_ADDRESS=peer0.org2.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org2.example.com:7052
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051
- CORE_PEER_LOCALMSPID=Org2MSP
volumes:
- ./crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls:/etc/hyperledger/fabric/tls
ports:
- 9051:7051
peer1.org2.example.com:
extends:
file: base.yaml
service: peer-base
container_name: peer1.org2.example.com
hostname: peer1.org2.example.com
environment:
- CORE_PEER_ID=peer1.org2.example.com
- CORE_PEER_ADDRESS=peer1.org2.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org2.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer1.org2.example.com:7052
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org2.example.com:7051
- CORE_PEER_LOCALMSPID=Org2MSP
volumes:
- ./crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls:/etc/hyperledger/fabric/tls
ports:
- 10051:7051
cli:
extends:
file: base.yaml
service: cli-base
container_name: fabric-cli
hostname: fabric-cli
tty: true
environment:
- CORE_PEER_ID=fabric-cli
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051 # default to operate on peer0.org1
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
volumes:
- ./scripts:/tmp/scripts
- ./crypto-config.yaml:/etc/hyperledger/fabric/crypto-config.yaml
- ./crypto-config:/etc/hyperledger/fabric/crypto-config
- ./raft/channel-artifacts:/tmp/channel-artifacts
- ./raft/configtx.yaml:/etc/hyperledger/fabric/configtx.yaml
- ./chaincodes:/go/src/chaincodes
#- $GOPATH/src/github.com/hyperledger/fabric:/go/src/github.com/hyperledger/fabric
sdk-node:
extends:
file: base.yaml
service: sdk-node
container_name: sdk-node
hostname: sdk-node
tty: true
volumes:
- ./crypto-config:/opt/crypto-config
- ./sdk-node:/opt/test
gateway-java:
extends:
file: base.yaml
service: gateway-java
container_name: gateway-java
hostname: gateway-java
tty: true
volumes:
- ./crypto-config:/opt/crypto-config
- ./gateway-java:/opt/test