2017-04-06 17:50:34 +08:00
|
|
|
# https://github.com/yeasy/docker-compose-files/tree/master/hyperledger
|
|
|
|
# This compose file will start a Hyperledger Fabric 1.0 MVE, including
|
|
|
|
# * ca
|
|
|
|
# * orderer
|
|
|
|
# * peer
|
|
|
|
# * sdk for testing
|
|
|
|
|
|
|
|
version: '2.0'
|
|
|
|
|
|
|
|
services:
|
|
|
|
ca:
|
|
|
|
image: hyperledger/fabric-ca
|
|
|
|
container_name: fabric-ca
|
|
|
|
hostname: ca
|
|
|
|
# command: /go/src/github.com/hyperledger/fabric-ca/bin/ca server start -ca testdata/ec.pem -ca-key testdata/ec-key.pem -config testdata/testconfig.json
|
|
|
|
ports:
|
|
|
|
- "8888:8888"
|
2017-04-18 17:11:24 +08:00
|
|
|
command: fabric-ca-server start -b admin:adminpw
|
2017-04-06 17:50:34 +08:00
|
|
|
|
2017-05-09 11:29:19 +08:00
|
|
|
orderer.example.com: # There can be multiple orderers
|
2017-04-06 17:50:34 +08:00
|
|
|
image: hyperledger/fabric-orderer
|
2017-05-09 11:29:19 +08:00
|
|
|
container_name: orderer.example.com
|
|
|
|
hostname: orderer.example.com
|
2017-04-06 17:50:34 +08:00
|
|
|
environment:
|
2017-05-09 11:29:19 +08:00
|
|
|
- ORDERER_GENERAL_LOGLEVEL=INFO
|
|
|
|
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
|
|
|
|
- ORDERER_GENERAL_GENESISMETHOD=file
|
|
|
|
- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block #Need to be confirm orderer.block
|
|
|
|
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
|
|
|
|
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
|
2017-04-06 17:50:34 +08:00
|
|
|
- ORDERER_GENERAL_LEDGERTYPE=ram
|
|
|
|
- ORDERER_GENERAL_BATCHTIMEOUT=10s
|
|
|
|
- ORDERER_GENERAL_MAXMESSAGECOUNT=10
|
|
|
|
- ORDERER_GENERAL_MAXWINDOWSIZE=1000
|
|
|
|
- ORDERER_GENERAL_LISTENPORT=7050
|
|
|
|
- ORDERER_RAMLEDGER_HISTORY_SIZE=100
|
|
|
|
- ORDERER_GENERAL_TLS_ENABLED=false # to enable TLS, make this true
|
2017-05-09 11:29:19 +08:00
|
|
|
- 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]
|
2017-04-06 17:50:34 +08:00
|
|
|
ports:
|
|
|
|
- "7050:7050"
|
|
|
|
volumes:
|
2017-05-09 11:29:19 +08:00
|
|
|
- ./e2e_cli/channel-artifacts/orderer.genesis.block:/var/hyperledger/orderer/orderer.genesis.block
|
|
|
|
- ./e2e_cli/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp
|
|
|
|
- ./e2e_cli/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls
|
2017-04-06 17:50:34 +08:00
|
|
|
command: orderer
|
|
|
|
|
2017-05-09 11:29:19 +08:00
|
|
|
peer0.org1.example.com:
|
2017-04-06 17:50:34 +08:00
|
|
|
extends:
|
|
|
|
file: peer.yml
|
|
|
|
service: peer
|
2017-05-09 11:29:19 +08:00
|
|
|
container_name: peer0.org1.example.com
|
|
|
|
hostname: peer0.org1.example.com
|
2017-04-06 17:50:34 +08:00
|
|
|
environment:
|
2017-05-09 11:29:19 +08:00
|
|
|
- CORE_PEER_ID=peer0.org1.example.com
|
|
|
|
- CORE_PEER_ADDRESS=peer0.org1:7051
|
|
|
|
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
|
2017-04-06 17:50:34 +08:00
|
|
|
- CORE_PEER_GOSSIP_ORGLEADER=true
|
2017-05-09 11:29:19 +08:00
|
|
|
- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer.example.com:7050
|
|
|
|
- CORE_PEER_LOCALMSPID=Org1MSP
|
|
|
|
- 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
|
2017-04-06 17:50:34 +08:00
|
|
|
links:
|
2017-05-09 11:29:19 +08:00
|
|
|
- orderer.example.com
|
2017-04-06 17:50:34 +08:00
|
|
|
ports:
|
|
|
|
- 7051:7051
|
|
|
|
- 7053:7053
|
|
|
|
volumes:
|
2017-05-09 11:29:19 +08:00
|
|
|
- ./e2e_cli/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp
|
|
|
|
- ./e2e_cli/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls
|
2017-04-06 17:50:34 +08:00
|
|
|
depends_on:
|
2017-05-09 11:29:19 +08:00
|
|
|
- orderer.example.com
|
2017-04-06 17:50:34 +08:00
|
|
|
command: peer node start --peer-defaultchain=false
|
|
|
|
|
|
|
|
cli:
|
|
|
|
extends:
|
|
|
|
file: peer.yml
|
|
|
|
service: peer
|
|
|
|
container_name: fabric-cli
|
|
|
|
hostname: cli
|
|
|
|
environment:
|
|
|
|
- CORE_PEER_ID=cli
|
2017-05-09 11:29:19 +08:00
|
|
|
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
|
|
|
|
- CORE_PEER_LOCALMSPID=Org1MSP
|
2017-04-06 17:50:34 +08:00
|
|
|
#- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
|
|
|
|
- CORE_PEER_TLS_ENABLED=false # to enable TLS, change to true
|
2017-05-09 11:29:19 +08:00
|
|
|
- CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
|
|
|
|
- CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
|
|
|
|
- CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
|
|
|
|
- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
|
2017-04-06 17:50:34 +08:00
|
|
|
links:
|
2017-05-09 11:29:19 +08:00
|
|
|
- peer0.org1.example.com
|
|
|
|
- orderer.example.com
|
2017-04-06 17:50:34 +08:00
|
|
|
volumes:
|
2017-05-09 11:29:19 +08:00
|
|
|
- ./e2e_cli/examples:/opt/gopath/src/github.com/hyperledger/fabric/examples
|
|
|
|
- ./e2e_cli/crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
|
2017-04-14 12:08:18 +08:00
|
|
|
- ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
|
2017-05-09 11:29:19 +08:00
|
|
|
- ./e2e_cli/channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
|
|
|
|
- ./e2e_cli/configtx.yaml:/opt/gopath/src/github.com/hyperledger/fabric/peer/configtx.yaml
|
|
|
|
- ./e2e_cli/crypto-config.yaml:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto-config.yaml
|
2017-04-06 17:50:34 +08:00
|
|
|
depends_on:
|
2017-05-09 11:29:19 +08:00
|
|
|
- peer0.org1.example.com
|
|
|
|
- orderer.example.com
|
2017-05-04 22:15:51 +08:00
|
|
|
command: bash -c 'while true; do sleep 20170504; done'
|
2017-04-06 17:50:34 +08:00
|
|
|
|
|
|
|
#networks:
|
|
|
|
# default:
|
|
|
|
# external:
|
|
|
|
# name: hyperledger_fabric
|