Skip to content

Instantly share code, notes, and snippets.

@kctam
Created April 7, 2019 06:05
Show Gist options
  • Save kctam/027584ad55a0d65d6258fc13573cc8cb to your computer and use it in GitHub Desktop.
Save kctam/027584ad55a0d65d6258fc13573cc8cb to your computer and use it in GitHub Desktop.
3node2channel setup
version: '2'
networks:
fabric:
services:
peer0.org3.example.com:
extends:
file: docker-compose-base.yml
service: peer
container_name: peer0.org3.example.com
environment:
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org3.example.com:7052
- CORE_PEER_ID=peer0.org3.example.com
- CORE_PEER_ADDRESS=peer0.org3.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_LOCALMSPID=Org3MSP
- CORE_PEER_TLS_CLIENTROOTCAS_FILES=/var/hyperledger/users/Admin@org3.example.com/tls/ca.crt
- CORE_PEER_TLS_CLIENTCERT_FILE=/var/hyperledger/users/Admin@org3.example.com/tls/client.crt
- CORE_PEER_TLS_CLIENTKEY_FILE=/var/hyperledger/users/Admin@org3.example.com/tls/client.key
volumes:
- ../crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/msp:/var/hyperledger/msp
- ../crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls:/var/hyperledger/tls
- ../crypto-config/peerOrganizations/org3.example.com/users:/var/hyperledger/users
- ../channel-artifacts/:/var/hyperledger/configs
extra_hosts:
- "orderer.example.com:172.31.60.217"
- "peer0.org1.example.com:172.31.58.209"
- "peer0.org2.example.com:172.31.51.44"
networks:
fabric:
aliases:
- net
ports:
- 7051:7051
- 7053:7053
cli:
container_name: cli
image: hyperledger/fabric-tools
tty: true
environment:
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_ID=cli
- CORE_PEER_ADDRESS=peer0.org3.example.com:7051
- CORE_PEER_LOCALMSPID=Org3MSP
- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp
- CORE_CHAINCODE_KEEPALIVE=10
extra_hosts:
- "orderer.example.com:172.31.60.217"
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: /bin/bash
volumes:
- /var/run/:/host/var/run/
- ../../chaincode/:/opt/gopath/src/github.com/chaincode
- $GOPATH/src/github.com/hyperledger/fabric/:/opt/gopath/src/github.com/hyperledger/fabric/
- ../crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
- ../channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts/
depends_on:
- peer0.org3.example.com
networks:
- fabric
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment