Skip to content

Instantly share code, notes, and snippets.

@snavruzov
Created March 5, 2019 09:28
Show Gist options
  • Save snavruzov/c3537d606161bc033b2ad40cd82210e5 to your computer and use it in GitHub Desktop.
Save snavruzov/c3537d606161bc033b2ad40cd82210e5 to your computer and use it in GitHub Desktop.
Hyperledger Fabric Kafka consensus based network
version: '2'
networks:
dcode:
services:
zookeeper0:
extends:
file: docker-compose-base.yml
service: zookeeper
container_name: zookeeper0
environment:
- ZOO_MY_ID=1
- ZOO_SERVERS=server.1=zookeeper0:2888:3888
networks:
dcode:
aliases:
- ${CORE_PEER_NETWORKID}
kafka0:
extends:
file: docker-compose-base.yml
service: kafka
container_name: kafka0
environment:
- KAFKA_BROKER_ID=0
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka0:9092
- KAFKA_ZOOKEEPER_CONNECT=zookeeper0:2181
- KAFKA_MESSAGE_MAX_BYTES=${KAFKA_MESSAGE_MAX_BYTES}
- KAFKA_REPLICA_FETCH_MAX_BYTES=${KAFKA_REPLICA_FETCH_MAX_BYTES}
- KAFKA_REPLICA_FETCH_RESPONSE_MAX_BYTES=${KAFKA_REPLICA_FETCH_RESPONSE_MAX_BYTES}
depends_on:
- zookeeper0
ports:
- 9092:9092
networks:
dcode:
aliases:
- ${CORE_PEER_NETWORKID}
kafka1:
extends:
file: docker-compose-base.yml
service: kafka
container_name: kafka1
environment:
- KAFKA_BROKER_ID=1
- KAFKA_ZOOKEEPER_CONNECT=zookeeper0:2181
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka1:9092
- KAFKA_MESSAGE_MAX_BYTES=${KAFKA_MESSAGE_MAX_BYTES}
- KAFKA_REPLICA_FETCH_MAX_BYTES=${KAFKA_REPLICA_FETCH_MAX_BYTES}
- KAFKA_REPLICA_FETCH_RESPONSE_MAX_BYTES=${KAFKA_REPLICA_FETCH_RESPONSE_MAX_BYTES}
depends_on:
- zookeeper0
ports:
- 19092:9092
networks:
dcode:
aliases:
- ${CORE_PEER_NETWORKID}
orderer0.dcode.team:
extends:
file: docker-compose-base.yml
service: orderer
container_name: orderer0.dcode.team
environment:
- ORDERER_HOST=orderer0.dcode.team
- CONFIGTX_ORDERER_ORDERERTYPE=kafka
- CONFIGTX_ORDERER_KAFKA_BROKERS=[kafka0:9092,kafka1:9092]
- ORDERER_KAFKA_RETRY_SHORTINTERVAL=1s
- ORDERER_KAFKA_RETRY_SHORTTOTAL=30s
- ORDERER_KAFKA_VERBOSE=true
- ORDERER_GENERAL_GENESISPROFILE=SampleInsecureKafka
- ORDERER_ABSOLUTEMAXBYTES=${ORDERER_ABSOLUTEMAXBYTES}
- ORDERER_PREFERREDMAXBYTES=${ORDERER_PREFERREDMAXBYTES}
volumes:
- ../crypto-config/ordererOrganizations/dcode.team/orderers/orderer0.dcode.team/msp:/var/hyperledger/msp
- ../crypto-config/ordererOrganizations/dcode.team/orderers/orderer0.dcode.team/tls:/var/hyperledger/tls
- ../config/:/var/hyperledger/configs
depends_on:
- kafka0
- kafka1
networks:
dcode:
aliases:
- ${CORE_PEER_NETWORKID}
ports:
- 7050:7050
orderer1.dcode.team:
extends:
file: docker-compose-base.yml
service: orderer
container_name: orderer1.dcode.team
environment:
- ORDERER_HOST=orderer1.dcode.team
- CONFIGTX_ORDERER_ORDERERTYPE=kafka
- CONFIGTX_ORDERER_KAFKA_BROKERS=[kafka0:9092,kafka1:9092]
- ORDERER_KAFKA_RETRY_SHORTINTERVAL=1s
- ORDERER_KAFKA_RETRY_SHORTTOTAL=30s
- ORDERER_KAFKA_RETRY_LONGINTERVAL=30s
- ORDERER_KAFKA_RETRY_LONGTOTAL=5m
- ORDERER_KAFKA_VERBOSE=true
- ORDERER_GENERAL_GENESISPROFILE=SampleInsecureKafka
- ORDERER_ABSOLUTEMAXBYTES=${ORDERER_ABSOLUTEMAXBYTES}
- ORDERER_PREFERREDMAXBYTES=${ORDERER_PREFERREDMAXBYTES}
volumes:
- ../crypto-config/ordererOrganizations/dcode.team/orderers/orderer1.dcode.team/msp:/var/hyperledger/msp
- ../crypto-config/ordererOrganizations/dcode.team/orderers/orderer1.dcode.team/tls:/var/hyperledger/tls
- ../config/:/var/hyperledger/configs
depends_on:
- kafka0
- kafka1
networks:
dcode:
aliases:
- ${CORE_PEER_NETWORKID}
ports:
- 8050:7050
couchdb01:
extends:
file: docker-compose-base.yml
service: couchdb
container_name: couchdb01
# Comment/Uncomment the port mapping if you want to hide/expose the CouchDB service,
# for example map it to utilize Fauxton User Interface in dev environments.
ports:
- "5984:5984"
networks:
dcode:
aliases:
- ${CORE_PEER_NETWORKID}
peer0.tash.dcode.team:
extends:
file: docker-compose-base.yml
service: peer
container_name: peer0.tash.dcode.team
environment:
- CORE_LEDGER_STATE_STATEDATABASE=CouchDB
- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb01:5984
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.tash.dcode.team:7052
- CORE_PEER_ID=peer0.tash.dcode.team
- CORE_PEER_ADDRESS=peer0.tash.dcode.team:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.tash.dcode.team:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.tash.dcode.team:7051
- CORE_PEER_GOSSIP_ORGLEADER=${CORE_PEER_GOSSIP_ORGLEADER_PEER0_TASH}
- CORE_PEER_GOSSIP_USELEADERELECTION=${CORE_PEER_GOSSIP_USELEADERELECTION_PEER0_TASH}
- CORE_PEER_LOCALMSPID=TashkentMSP
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_TLS_CLIENTROOTCAS_FILES=/var/hyperledger/users/[email protected]/tls/ca.crt
- CORE_PEER_TLS_CLIENTCERT_FILE=/var/hyperledger/users/[email protected]/tls/client.crt
- CORE_PEER_TLS_CLIENTKEY_FILE=/var/hyperledger/users/[email protected]/tls/client.key
volumes:
- ../crypto-config/peerOrganizations/tash.dcode.team/peers/peer0.tash.dcode.team/msp:/var/hyperledger/msp
- ../crypto-config/peerOrganizations/tash.dcode.team/peers/peer0.tash.dcode.team/tls:/var/hyperledger/tls
- ../crypto-config/peerOrganizations/tash.dcode.team/users:/var/hyperledger/users
- ../config/:/var/hyperledger/configs
depends_on:
- orderer0.dcode.team
- orderer1.dcode.team
- couchdb01
networks:
dcode:
aliases:
- ${CORE_PEER_NETWORKID}
ports:
- 7051:7051
- 7053:7053
peer0.sam.dcode.team:
extends:
file: docker-compose-base.yml
service: peer
container_name: peer0.sam.dcode.team
environment:
- CORE_LEDGER_STATE_STATEDATABASE=CouchDB
- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb01:5984
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.sam.dcode.team:7052
- CORE_PEER_ID=peer0.sam.dcode.team
- CORE_PEER_ADDRESS=peer0.sam.dcode.team:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.sam.dcode.team:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.sam.dcode.team:7051
- CORE_PEER_GOSSIP_ORGLEADER=${CORE_PEER_GOSSIP_ORGLEADER_PEER0_SAM}
- CORE_PEER_GOSSIP_USELEADERELECTION=${CORE_PEER_GOSSIP_USELEADERELECTION_PEER0_SAM}
- CORE_PEER_LOCALMSPID=SamarqandMSP
- CORE_PEER_TLS_CLIENTROOTCAS_FILES=/var/hyperledger/users/[email protected]/tls/ca.crt
- CORE_PEER_TLS_CLIENTCERT_FILE=/var/hyperledger/users/[email protected]/tls/client.crt
- CORE_PEER_TLS_CLIENTKEY_FILE=/var/hyperledger/users/[email protected]/tls/client.key
volumes:
- ../crypto-config/peerOrganizations/sam.dcode.team/peers/peer0.sam.dcode.team/msp:/var/hyperledger/msp
- ../crypto-config/peerOrganizations/sam.dcode.team/peers/peer0.sam.dcode.team/tls:/var/hyperledger/tls
- ../crypto-config/peerOrganizations/sam.dcode.team/users:/var/hyperledger/users
- ../config/:/var/hyperledger/configs
depends_on:
- orderer0.dcode.team
- orderer1.dcode.team
- couchdb01
networks:
dcode:
aliases:
- ${CORE_PEER_NETWORKID}
ports:
- 9051:7051
- 9053:7053
peer1.tash.dcode.team:
extends:
file: docker-compose-base.yml
service: peer
container_name: peer1.tash.dcode.team
environment:
- CORE_LEDGER_STATE_STATEDATABASE=CouchDB
- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb01:5984
- CORE_PEER_CHAINCODELISTENADDRESS=peer1.tash.dcode.team:7052
- CORE_PEER_ID=peer1.tash.dcode.team
- CORE_PEER_ADDRESS=peer1.tash.dcode.team:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.tash.dcode.team:7051
- CORE_PEER_GOSSIP_ORGLEADER=${CORE_PEER_GOSSIP_ORGLEADER_PEER1_TASH}
- CORE_PEER_GOSSIP_USELEADERELECTION=${CORE_PEER_GOSSIP_USELEADERELECTION_PEER1_TASH}
- CORE_PEER_LOCALMSPID=TashkentMSP
- CORE_PEER_TLS_CLIENTROOTCAS_FILES=/var/hyperledger/users/[email protected]/tls/ca.crt
- CORE_PEER_TLS_CLIENTCERT_FILE=/var/hyperledger/users/[email protected]/tls/client.crt
- CORE_PEER_TLS_CLIENTKEY_FILE=/var/hyperledger/users/[email protected]/tls/client.key
volumes:
- ../crypto-config/peerOrganizations/tash.dcode.team/peers/peer1.tash.dcode.team/msp:/var/hyperledger/msp
- ../crypto-config/peerOrganizations/tash.dcode.team/peers/peer1.tash.dcode.team/tls:/var/hyperledger/tls
- ../crypto-config/peerOrganizations/tash.dcode.team/users:/var/hyperledger/users
- ../config/:/var/hyperledger/configs
depends_on:
- orderer0.dcode.team
- orderer1.dcode.team
- peer0.tash.dcode.team
- couchdb01
networks:
dcode:
aliases:
- ${CORE_PEER_NETWORKID}
ports:
- 8051:7051
- 8053:7053
peer1.sam.dcode.team:
extends:
file: docker-compose-base.yml
service: peer
container_name: peer1.sam.dcode.team
environment:
- CORE_LEDGER_STATE_STATEDATABASE=CouchDB
- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb01:5984
- CORE_PEER_CHAINCODELISTENADDRESS=peer1.sam.dcode.team:7052
- CORE_PEER_ID=peer1.sam.dcode.team
- CORE_PEER_ADDRESS=peer1.sam.dcode.team:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.sam.dcode.team:7051
- CORE_PEER_GOSSIP_ORGLEADER=${CORE_PEER_GOSSIP_ORGLEADER_PEER1_SAM}
- CORE_PEER_GOSSIP_USELEADERELECTION=${CORE_PEER_GOSSIP_USELEADERELECTION_PEER1_SAM}
- CORE_PEER_LOCALMSPID=SamarqandMSP
- CORE_PEER_TLS_CLIENTROOTCAS_FILES=/var/hyperledger/users/[email protected]/tls/ca.crt
- CORE_PEER_TLS_CLIENTCERT_FILE=/var/hyperledger/users/[email protected]/tls/client.crt
- CORE_PEER_TLS_CLIENTKEY_FILE=/var/hyperledger/users/[email protected]/tls/client.key
volumes:
- ../crypto-config/peerOrganizations/sam.dcode.team/peers/peer1.sam.dcode.team/msp:/var/hyperledger/msp
- ../crypto-config/peerOrganizations/sam.dcode.team/peers/peer1.sam.dcode.team/tls:/var/hyperledger/tls
- ../crypto-config/peerOrganizations/sam.dcode.team/users:/var/hyperledger/users
- ../config/:/var/hyperledger/configs
depends_on:
- orderer0.dcode.team
- orderer1.dcode.team
- peer0.sam.dcode.team
- couchdb01
networks:
dcode:
aliases:
- ${CORE_PEER_NETWORKID}
ports:
- 10051:7051
- 10053:7053
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment