|
@@ -1,213 +1,134 @@
|
|
|
version: '2'
|
|
|
|
|
|
services:
|
|
|
+ ca0:
|
|
|
+ image: hyperledger/fabric-ca
|
|
|
+ environment:
|
|
|
+ - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
|
|
|
+ ports:
|
|
|
+ - "7054:7054"
|
|
|
+ command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/a22daf356b2aab5792ea53e35f66fccef1d7f1aa2b3a2b92dbfbf96a448ea26a_sk -b admin:adminpw' -d
|
|
|
+ volumes:
|
|
|
+ - ./channel/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
|
|
|
+ - ./fabricca/tlsOrg1:/etc/hyperledger/fabric-ca-server
|
|
|
+ container_name: ca_peerOrg1
|
|
|
+
|
|
|
+ ca1:
|
|
|
+ image: hyperledger/fabric-ca
|
|
|
+ environment:
|
|
|
+ - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
|
|
|
+ ports:
|
|
|
+ - "8054:7054"
|
|
|
+ command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/org2.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/464d550fe9bf9e7d8976cdf59d1a5d472598f54c058c3546317c5c5fb0ddfd6e_sk -b admin:adminpw' -d
|
|
|
+ volumes:
|
|
|
+ - ./channel/crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
|
|
|
+ - ./fabricca/tlsOrg2:/etc/hyperledger/fabric-ca-server
|
|
|
+ container_name: ca_peerOrg2
|
|
|
|
|
|
orderer0:
|
|
|
container_name: orderer0
|
|
|
image: hyperledger/fabric-orderer
|
|
|
environment:
|
|
|
+ - GRPC_TRACE=all
|
|
|
+ - GRPC_VERBOSITY=debug
|
|
|
- ORDERER_GENERAL_LOGLEVEL=debug
|
|
|
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
|
|
|
- ORDERER_GENERAL_GENESISMETHOD=file
|
|
|
- - ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.block
|
|
|
+ - ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/twoorgs.genesis.block
|
|
|
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
|
|
|
- - ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/localMspConfig
|
|
|
- # enabled TLS
|
|
|
+ - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/msp/orderer
|
|
|
- ORDERER_GENERAL_TLS_ENABLED=true
|
|
|
- - ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/localMspConfig/keystore/ordererSigner.pem
|
|
|
- - ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/localMspConfig/signcerts/orderer0Signer.pem
|
|
|
- - ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/localMspConfig/cacerts/ordererOrg0.pem]
|
|
|
- working_dir: /opt/gopath/src/github.com/hyperledger/fabric
|
|
|
+ - ORDERER_GENERAL_TLS_PRIVATEKEY=/etc/hyperledger/tls/orderer/key.pem
|
|
|
+ - ORDERER_GENERAL_TLS_CERTIFICATE=/etc/hyperledger/tls/orderer/cert.pem
|
|
|
+ - ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/tls/orderer/ca-cert.pem, /etc/hyperledger/tls/peers/peer0/ca-cert.pem, /etc/hyperledger/tls/peers/peer2/ca-cert.pem]
|
|
|
+ working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
|
|
|
command: orderer
|
|
|
- volumes:
|
|
|
- - ./crypto/orderer:/var/hyperledger/orderer
|
|
|
ports:
|
|
|
- 7050:7050
|
|
|
-
|
|
|
-## To enable CouchDB as state database, uncomment the following sections of this file:
|
|
|
-## 1) couchdb containers
|
|
|
-## 2) peer environment variables CORE_LEDGER_STATE_STATEDATABASE and
|
|
|
-## CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS
|
|
|
-## 3) couch container names in "depends_on" section
|
|
|
-
|
|
|
- couchdb0:
|
|
|
- container_name: couchdb0
|
|
|
- image: hyperledger/fabric-couchdb
|
|
|
-# Uncomment the port mapping if you want to expose the CouchDB service,
|
|
|
-# for example to utilize Fauxton User Interface in dev environments.
|
|
|
- ports:
|
|
|
- - "5984:5984"
|
|
|
+ volumes:
|
|
|
+ - ./channel:/etc/hyperledger/configtx
|
|
|
+ - ./channel/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/:/etc/hyperledger/msp/orderer
|
|
|
+ - ./tls/orderer:/etc/hyperledger/tls/orderer
|
|
|
+ - ./tls/peers:/etc/hyperledger/tls/peers
|
|
|
|
|
|
peer0:
|
|
|
container_name: peer0
|
|
|
- extends:
|
|
|
- file: peer-base/peer-base.yaml
|
|
|
- service: peer-base
|
|
|
+ image: hyperledger/fabric-peer
|
|
|
environment:
|
|
|
+ - GRPC_TRACE=all
|
|
|
+ - GRPC_VERBOSITY=debug
|
|
|
+ - CORE_NEXT=true
|
|
|
+ - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
|
|
|
- CORE_PEER_ID=peer0
|
|
|
+ - CORE_PEER_ENDORSER_ENABLED=true
|
|
|
+ - CORE_PEER_LOCALMSPID=Org1MSP
|
|
|
+ - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
|
|
|
+ - CORE_PEER_GOSSIP_USELEADERELECTION=true
|
|
|
+ - CORE_PEER_GOSSIP_ORGLEADER=false
|
|
|
- CORE_PEER_ADDRESS=peer0:7051
|
|
|
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0:7051
|
|
|
- - CORE_PEER_LOCALMSPID=Org0MSP
|
|
|
- - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/signcerts/peer0Signer.pem
|
|
|
- - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/msp/sampleconfig/keystore/peer0Signer.pem
|
|
|
- - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/cacerts/peerOrg0.pem
|
|
|
- # - CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer0
|
|
|
- - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
|
|
|
- - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb0:5984
|
|
|
- volumes:
|
|
|
- - /var/run/:/host/var/run/
|
|
|
- - ./crypto/peer/peer0/localMspConfig:/etc/hyperledger/fabric/msp/sampleconfig
|
|
|
+ - CORE_PEER_TLS_ENABLED=true
|
|
|
+ - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/tls/key.pem
|
|
|
+ - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/tls/cert.pem
|
|
|
+ - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/tls/ca-cert.pem
|
|
|
+ # the following setting starts chaincode containers on the same
|
|
|
+ # bridge network as the peers
|
|
|
+ # https://docs.docker.com/compose/networking/
|
|
|
+ - CORE_PEER_GOSSIP_SKIPHANDSHAKE=true
|
|
|
+ - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=fixtures_default
|
|
|
+ working_dir: /opt/gopath/src/github.com/hyperledger/fabric
|
|
|
+ command: peer node start --peer-defaultchain=false
|
|
|
ports:
|
|
|
- 7051:7051
|
|
|
- 7053:7053
|
|
|
- depends_on:
|
|
|
- - orderer0
|
|
|
- - couchdb0
|
|
|
-
|
|
|
- couchdb1:
|
|
|
- container_name: couchdb1
|
|
|
- image: hyperledger/fabric-couchdb
|
|
|
-# Uncomment the port mapping if you want to expose the CouchDB service,
|
|
|
-# for example to utilize Fauxton User Interface in dev environments.
|
|
|
- ports:
|
|
|
- - "6984:5984"
|
|
|
-
|
|
|
- peer1:
|
|
|
- container_name: peer1
|
|
|
- extends:
|
|
|
- file: peer-base/peer-base.yaml
|
|
|
- service: peer-base
|
|
|
- environment:
|
|
|
- - CORE_PEER_ID=peer1
|
|
|
- - CORE_PEER_ADDRESS=peer1:7051
|
|
|
- - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1:7051
|
|
|
- - CORE_PEER_GOSSIP_BOOTSTRAP=peer0:7051
|
|
|
- - CORE_PEER_LOCALMSPID=Org0MSP
|
|
|
- - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/signcerts/peer1Signer.pem
|
|
|
- - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/msp/sampleconfig/keystore/peer1Signer.pem
|
|
|
- - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/cacerts/peerOrg0.pem
|
|
|
- # - CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer1
|
|
|
- - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
|
|
|
- - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb1:5984
|
|
|
volumes:
|
|
|
- - /var/run/:/host/var/run/
|
|
|
- - ./crypto/peer/peer1/localMspConfig:/etc/hyperledger/fabric/msp/sampleconfig
|
|
|
- ports:
|
|
|
- - 8051:7051
|
|
|
- - 8053:7053
|
|
|
+ - /var/run/:/host/var/run/
|
|
|
+ - ./channel/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/:/etc/hyperledger/msp/peer
|
|
|
+ - ./tls/peers/peer0:/etc/hyperledger/tls
|
|
|
depends_on:
|
|
|
- orderer0
|
|
|
- - peer0
|
|
|
- - couchdb1
|
|
|
-
|
|
|
- couchdb2:
|
|
|
- container_name: couchdb2
|
|
|
- image: hyperledger/fabric-couchdb
|
|
|
-# Uncomment the port mapping if you want to expose the CouchDB service,
|
|
|
-# for example to utilize Fauxton User Interface in dev environments.
|
|
|
- ports:
|
|
|
- - "7984:5984"
|
|
|
|
|
|
peer2:
|
|
|
container_name: peer2
|
|
|
- extends:
|
|
|
- file: peer-base/peer-base.yaml
|
|
|
- service: peer-base
|
|
|
+ image: hyperledger/fabric-peer
|
|
|
environment:
|
|
|
+ - CORE_NEXT=true
|
|
|
+ - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
|
|
|
- CORE_PEER_ID=peer2
|
|
|
+ - CORE_PEER_ENDORSER_ENABLED=true
|
|
|
+ - CORE_PEER_LOCALMSPID=Org2MSP
|
|
|
+ - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
|
|
|
+ - CORE_PEER_GOSSIP_USELEADERELECTION=true
|
|
|
+ - CORE_PEER_GOSSIP_ORGLEADER=false
|
|
|
- CORE_PEER_ADDRESS=peer2:7051
|
|
|
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer2:7051
|
|
|
- - CORE_PEER_GOSSIP_BOOTSTRAP=peer2:7051
|
|
|
- - CORE_PEER_LOCALMSPID=Org1MSP
|
|
|
- - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/signcerts/peer2Signer.pem
|
|
|
- - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/msp/sampleconfig/keystore/peer2Signer.pem
|
|
|
- - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/admincerts/peerOrg1.pem
|
|
|
- #- CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer2
|
|
|
- - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
|
|
|
- - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb2:5984
|
|
|
- volumes:
|
|
|
- - /var/run/:/host/var/run/
|
|
|
- - ./crypto/peer/peer2/localMspConfig:/etc/hyperledger/fabric/msp/sampleconfig
|
|
|
+ - CORE_PEER_TLS_ENABLED=true
|
|
|
+ - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/tls/key.pem
|
|
|
+ - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/tls/cert.pem
|
|
|
+ - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/tls/ca-cert.pem
|
|
|
+ # the following setting starts chaincode containers on the same
|
|
|
+ # bridge network as the peers
|
|
|
+ # https://docs.docker.com/compose/networking/
|
|
|
+ - CORE_PEER_GOSSIP_SKIPHANDSHAKE=true
|
|
|
+ - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=fixtures_default
|
|
|
+ working_dir: /opt/gopath/src/github.com/hyperledger/fabric
|
|
|
+ command: peer node start --peer-defaultchain=false
|
|
|
ports:
|
|
|
- - 9051:7051
|
|
|
- - 9053:7053
|
|
|
+ - 8051:7051
|
|
|
+ - 8053:7053
|
|
|
+ volumes:
|
|
|
+ - /var/run/:/host/var/run/
|
|
|
+ - ./channel/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/:/etc/hyperledger/msp/peer
|
|
|
+ - ./tls/peers/peer2:/etc/hyperledger/tls
|
|
|
depends_on:
|
|
|
- orderer0
|
|
|
- - peer0
|
|
|
- - peer1
|
|
|
- - couchdb2
|
|
|
|
|
|
- couchdb3:
|
|
|
- container_name: couchdb3
|
|
|
+ couchdb:
|
|
|
+ container_name: couchdb
|
|
|
image: hyperledger/fabric-couchdb
|
|
|
-# Uncomment the port mapping if you want to expose the CouchDB service,
|
|
|
-# for example to utilize Fauxton User Interface in dev environments.
|
|
|
ports:
|
|
|
- - "8984:5984"
|
|
|
-
|
|
|
- peer3:
|
|
|
- container_name: peer3
|
|
|
- extends:
|
|
|
- file: peer-base/peer-base.yaml
|
|
|
- service: peer-base
|
|
|
+ - 5984:5984
|
|
|
environment:
|
|
|
- - CORE_PEER_ID=peer3
|
|
|
- - CORE_PEER_ADDRESS=peer3:7051
|
|
|
- - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer3:7051
|
|
|
- - CORE_PEER_GOSSIP_BOOTSTRAP=peer2:7051
|
|
|
- - CORE_PEER_LOCALMSPID=Org1MSP
|
|
|
- - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/signcerts/peer3Signer.pem
|
|
|
- - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/msp/sampleconfig/keystore/peer3Signer.pem
|
|
|
- - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/cacerts/peerOrg1.pem
|
|
|
- # - CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer3
|
|
|
- - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
|
|
|
- - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb3:5984
|
|
|
- volumes:
|
|
|
- - /var/run/:/host/var/run/
|
|
|
- - ./crypto/peer/peer3/localMspConfig:/etc/hyperledger/fabric/msp/sampleconfig
|
|
|
- ports:
|
|
|
- - 10051:7051
|
|
|
- - 10053:7053
|
|
|
- depends_on:
|
|
|
- - orderer0
|
|
|
- - peer0
|
|
|
- - peer1
|
|
|
- - peer2
|
|
|
- - couchdb3
|
|
|
+ DB_URL: http://localhost:5984/member_db
|
|
|
|
|
|
- cli:
|
|
|
- container_name: cli
|
|
|
- image: hyperledger/fabric-peer
|
|
|
- tty: true
|
|
|
- environment:
|
|
|
- - GOPATH=/opt/gopath
|
|
|
- - CORE_PEER_ADDRESSAUTODETECT=true
|
|
|
- - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
|
|
|
- - CORE_LOGGING_LEVEL=DEBUG
|
|
|
- - CORE_NEXT=true
|
|
|
- - CORE_PEER_ID=cli
|
|
|
- - CORE_PEER_ENDORSER_ENABLED=true
|
|
|
- - CORE_PEER_ADDRESS=peer0:7051
|
|
|
- - CORE_PEER_LOCALMSPID=Org0MSP
|
|
|
- - CORE_PEER_TLS_ENABLED=true
|
|
|
- - CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peer/peer0/localMspConfig/signcerts/peer0Signer.pem
|
|
|
- - CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peer/peer0/localMspConfig/keystore/peer0Signer.pem
|
|
|
- - CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peer/peer0/localMspConfig/cacerts/peerOrg0.pem
|
|
|
- # - CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer0
|
|
|
- - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peer/peer0/localMspConfig
|
|
|
|
|
|
- working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
|
|
|
- command: /bin/bash -c './scripts/script.sh ${CHANNEL_NAME}; '
|
|
|
- #command: /bin/bash
|
|
|
- volumes:
|
|
|
- - /var/run/:/host/var/run/
|
|
|
- - ./examples/:/opt/gopath/src/github.com/hyperledger/fabric/examples/
|
|
|
- - ../chaincode/go/:/opt/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go
|
|
|
- - ./crypto:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
|
|
|
- - ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
|
|
|
- depends_on:
|
|
|
- - orderer0
|
|
|
- - peer0
|
|
|
- - peer1
|
|
|
- - peer2
|
|
|
- - peer3
|