Channel creation fails with Hyperledger fabric through cli? - docker

Problem:
I am trying to build up a blockchain network from scratch using Hyperledger fabric. After creating crypto-config and channel artifacts and also changing the respective attribute in .ymal files I up the containers then when I try to create a channel through CLI it leaves me this error on console.
Cannot run peer because error when setting up MSP of type bccsp from
directory
//opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/doctor.pms.com/users/Admin#doctor.pms.com/msp:
Setup error: nil conf reference
This is my docker-compose-base.yaml file.
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
version: '2'
services:
orderer.pms.com:
container_name: orderer.pms.com
extends:
file: peer-base.yaml
service: orderer-base
volumes:
- ../channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
- ../crypto-config/ordererOrganizations/pms.com/orderers/orderer.pms.com/msp:/var/hyperledger/orderer/msp
- ../crypto-config/ordererOrganizations/pms.com/orderers/orderer.pms.com/tls/:/var/hyperledger/orderer/tls
- orderer.pms.com:/var/hyperledger/production/orderer
ports:
- 7050:7050
peer0.generalpublic.pms.com:
container_name: peer0.generalpublic.pms.com
extends:
file: peer-base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.generalpublic.pms.com
- CORE_PEER_ADDRESS=peer0.generalpublic.pms.com:7051
- CORE_PEER_LISTENADDRESS=0.0.0.0:7051
- CORE_PEER_CHAINCODEADDRESS=peer0.generalpublic.pms.com:7052
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:7052
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.generalpublic.pms.com:8051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.generalpublic.pms.com:7051
- CORE_PEER_LOCALMSPID=GeneralpublicMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/generalpublic.pms.com/peers/peer0.generalpublic.pms.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/generalpublic.pms.com/peers/peer0.generalpublic.pms.com/tls:/etc/hyperledger/fabric/tls
- peer0.generalpublic.pms.com:/var/hyperledger/production
ports:
- 7051:7051
peer1.generalpublic.pms.com:
container_name: peer1.generalpublic.pms.com
extends:
file: peer-base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.generalpublic.pms.com
- CORE_PEER_ADDRESS=peer1.generalpublic.pms.com:8051
- CORE_PEER_LISTENADDRESS=0.0.0.0:8051
- CORE_PEER_CHAINCODEADDRESS=peer1.generalpublic.pms.com:8052
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:8052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.generalpublic.pms.com:8051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.generalpublic.pms.com:7051
- CORE_PEER_LOCALMSPID=GeneralpublicMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/generalpublic.pms.com/peers/peer1.generalpublic.pms.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/generalpublic.pms.com/peers/peer1.generalpublic.pms.com/tls:/etc/hyperledger/fabric/tls
- peer1.generalpublic.pms.com:/var/hyperledger/production
ports:
- 8051:8051
peer0.doctor.pms.com:
container_name: peer0.doctor.pms.com
extends:
file: peer-base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.doctor.pms.com
- CORE_PEER_ADDRESS=peer0.doctor.pms.com:9051
- CORE_PEER_LISTENADDRESS=0.0.0.0:9051
- CORE_PEER_CHAINCODEADDRESS=peer0.doctor.pms.com:9052
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:9052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.doctor.pms.com:9051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.doctor.pms.com:10051
- CORE_PEER_LOCALMSPID=DoctorMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/doctor.pms.com/peers/peer0.doctor.pms.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/doctor.pms.com/peers/peer0.doctor.pms.com/tls:/etc/hyperledger/fabric/tls
- peer0.doctor.pms.com:/var/hyperledger/production
ports:
- 9051:9051
peer1.doctor.pms.com:
container_name: peer1.doctor.pms.com
extends:
file: peer-base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.doctor.doctor.com
- CORE_PEER_ADDRESS=peer1.doctor.pms.com:10051
- CORE_PEER_LISTENADDRESS=0.0.0.0:10051
- CORE_PEER_CHAINCODEADDRESS=peer1.doctor.pms.com:10052
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:10052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.doctor.pms.com:10051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.doctor.pms.com:9051
- CORE_PEER_LOCALMSPID=DoctorMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/doctor.pms.com/peers/peer1.doctor.pms.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/doctor.pms.com/peers/peer1.doctor.pms.com/tls:/etc/hyperledger/fabric/tls
- peer1.doctor.pms.com:/var/hyperledger/production
ports:
- 10051:10051
This is my docker-compose-cli.yaml file.
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
version: '2'
volumes:
orderer.pms.com:
peer0.generalpublic.pms.com:
peer1.generalpublic.pms.com:
peer0.doctor.pms.com:
peer1.doctor.pms.com:
ca.Generalpublic.pms.com:
ca.doctor.pms.com:
networks:
byfn:
services:
ca.generalpublic.pms.com:
image: hyperledger/fabric-ca:latest
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.generalpublic.pms.com
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.generalpublic.pms.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/929794a7d5a90f2fc4f2dbc53db66d27cba02f8efbed28ff1d14001e862a3574_sk
ports:
- "7054:7054"
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.generalpublic.pms.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/929794a7d5a90f2fc4f2dbc53db66d27cba02f8efbed28ff1d14001e862a3574_sk -b admin:adminpw -d'
volumes:
- ./crypto-config/peerOrganizations/generalpublic.pms.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca.generalpublic.pms.com
networks:
- byfn
ca.doctor.pms.com:
image: hyperledger/fabric-ca:latest
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.doctor.pms.com
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.doctor.pms.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/5c238614a373e903f982d5735db36fad9f2a2c5ce42fc6a9a3df6628a91657e4_sk
ports:
- "8054:7054"
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.doctor.pms.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/5c238614a373e903f982d5735db36fad9f2a2c5ce42fc6a9a3df6628a91657e4_sk -b admin:adminpw -d'
volumes:
- ./crypto-config/peerOrganizations/doctor.pms.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca.doctor.pms.com
networks:
- byfn
orderer.pms.com:
extends:
file: base/docker-compose-base.yaml
service: orderer.pms.com
container_name: orderer.pms.com
networks:
- byfn
peer0.generalpublic.pms.com:
container_name: peer0.generalpublic.pms.com
extends:
file: base/docker-compose-base.yaml
service: peer0.generalpublic.pms.com
networks:
- byfn
peer1.generalpublic.pms.com:
container_name: peer1.generalpublic.pms.com
extends:
file: base/docker-compose-base.yaml
service: peer1.generalpublic.pms.com
networks:
- byfn
peer0.doctor.pms.com:
container_name: peer0.doctor.pms.com
extends:
file: base/docker-compose-base.yaml
service: peer0.doctor.pms.com
networks:
- byfn
peer1.doctor.pms.com:
container_name: peer1.doctor.pms.com
extends:
file: base/docker-compose-base.yaml
service: peer1.doctor.pms.com
networks:
- byfn
cli:
container_name: cli
image: hyperledger/fabric-tools:latest
tty: true
stdin_open: true
environment:
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- FABRIC_LOGGING_SPEC=DEBUG
# - FABRIC_LOGGING_SPEC=INFO
- CORE_PEER_ID=cli
- CORE_PEER_ADDRESS=peer0.doctor.pms.com:9051
- CORE_PEER_LOCALMSPID=DoctorMSP
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/doctor.pms.com/peers/peer0.doctor.pms.com/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/doctor.pms.com/peers/peer0.doctor.pms.com/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/doctor.pms.com/peers/peer0.doctor.pms.com/tls/ca.crt
- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/doctor.pms.com/users/Admin#doctor.pms.com/msp
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
- ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
- ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
- ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
depends_on:
- orderer.pms.com
- peer0.generalpublic.pms.com
- peer1.generalpublic.pms.com
- peer0.doctor.pms.com
- peer1.doctor.pms.com
- ca.generalpublic.pms.com
- ca.doctor.pms.com
networks:
- byfn
I try to find out a solution to this problem on the internet but I was unable to find an exact solution to this problem. Can someone help me to find out a solution to this problem? Thank you.

Related

Trying to build hyperledger fabric2.0 on multiple hosts, no raft leader

I've tried to build hyperledger fabric2.0 on multiple hosts, following this passage:https://medium.com/#kctheservant/multi-host-setup-with-raft-based-ordering-service-29730788b171.
But when I execute this step to create channel genesis block:
docker exec cli peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
It said that "Error: got unexpected status: SERVICE_UNAVAILABLE -- no Raft leader".
(I can't paste image due to my reputation, sorry for that).
Would there be any cause or solution? Thank you for your attention.
————————————————————————————————————————————
That's the result I run
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
42a6033c4faf hyperledger/fabric-tools:2.0.0 "/bin/bash" 13 days ago Up 13 days cli
99574106c337 hyperledger/fabric-orderer:2.0.0 "orderer" 13 days ago Up 13 days 0.0.0.0:8050->7050/tcp orderer5.example.com
01117e5fc775 hyperledger/fabric-peer:2.0.0 "peer node start" 13 days ago Up 13 days 0.0.0.0:7051->7051/tcp peer0.org1.example.com
c936d551210c hyperledger/fabric-orderer:2.0.0 "orderer" 13 days ago Up 13 days 0.0.0.0:7050->7050/tcp orderer.example.com
Here are the yamls:
1.base/peer-base.yaml
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
version: '2'
services:
peer-base:
image: hyperledger/fabric-peer:$IMAGE_TAG
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
# the following setting starts chaincode containers on the same
# bridge network as the peers
# https://docs.docker.com/compose/networking/
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=first-network
- FABRIC_LOGGING_SPEC=INFO
#- FABRIC_LOGGING_SPEC=DEBUG
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_PROFILE_ENABLED=true
- 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
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: peer node start
orderer-base:
image: hyperledger/fabric-orderer:$IMAGE_TAG
environment:
- FABRIC_LOGGING_SPEC=INFO
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
# enabled TLS
- ORDERER_GENERAL_TLS_ENABLED=true
- 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]
- ORDERER_KAFKA_TOPIC_REPLICATIONFACTOR=1
- ORDERER_KAFKA_VERBOSE=true
- ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/var/hyperledger/orderer/tls/server.crt
- ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/var/hyperledger/orderer/tls/server.key
- ORDERER_GENERAL_CLUSTER_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: orderer
2.base/docker-compose-base.yaml
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
version: '2'
services:
orderer.example.com:
container_name: orderer.example.com
extends:
file: peer-base.yaml
service: orderer-base
volumes:
- ../channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
- ../crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp
- ../crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls
- orderer.example.com:/var/hyperledger/production/orderer
ports:
- 7050:7050
peer0.org1.example.com:
container_name: peer0.org1.example.com
extends:
file: peer-base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.org1.example.com
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_LISTENADDRESS=0.0.0.0:7051
- CORE_PEER_CHAINCODEADDRESS=peer0.org1.example.com:7052
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:7052
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org1.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
volumes:
- /var/run/:/host/var/run/
- ../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
- peer0.org1.example.com:/var/hyperledger/production
ports:
- 7051:7051
peer1.org1.example.com:
container_name: peer1.org1.example.com
extends:
file: peer-base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.org1.example.com
- CORE_PEER_ADDRESS=peer1.org1.example.com:7051
- CORE_PEER_LISTENADDRESS=0.0.0.0:7051
- CORE_PEER_CHAINCODEADDRESS=peer1.org1.example.com:7052
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
volumes:
- /var/run/:/host/var/run/
- ../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
- peer1.org1.example.com:/var/hyperledger/production
ports:
- 7051:7051
peer0.org2.example.com:
container_name: peer0.org2.example.com
extends:
file: peer-base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.org2.example.com
- CORE_PEER_ADDRESS=peer0.org2.example.com:7051
- CORE_PEER_LISTENADDRESS=0.0.0.0:7051
- CORE_PEER_CHAINCODEADDRESS=peer0.org2.example.com:7052
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org2.example.com:7051
- CORE_PEER_LOCALMSPID=Org2MSP
volumes:
- /var/run/:/host/var/run/
- ../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
- peer0.org2.example.com:/var/hyperledger/production
ports:
- 7051:7051
peer1.org2.example.com:
container_name: peer1.org2.example.com
extends:
file: peer-base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.org2.example.com
- CORE_PEER_ADDRESS=peer1.org2.example.com:7051
- CORE_PEER_LISTENADDRESS=0.0.0.0:7051
- CORE_PEER_CHAINCODEADDRESS=peer1.org2.example.com:7052
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org2.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051
- CORE_PEER_LOCALMSPID=Org2MSP
volumes:
- /var/run/:/host/var/run/
- ../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
- peer1.org2.example.com:/var/hyperledger/production
ports:
- 7051:7051
3.host1.yaml
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
version: '2'
volumes:
orderer.example.com:
orderer5.example.com:
peer0.org1.example.com:
networks:
byfn:
external:
name: first-network
services:
orderer.example.com:
extends:
file: base/docker-compose-base.yaml
service: orderer.example.com
container_name: orderer.example.com
networks:
- byfn
orderer5.example.com:
extends:
file: base/peer-base.yaml
service: orderer-base
container_name: orderer5.example.com
networks:
- byfn
volumes:
- ./channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer5.example.com/msp:/var/hyperledger/orderer/msp
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer5.example.com/tls/:/var/hyperledger/orderer/tls
- orderer5.example.com:/var/hyperledger/production/orderer
ports:
- 8050:7050
peer0.org1.example.com:
container_name: peer0.org1.example.com
extends:
file: base/docker-compose-base.yaml
service: peer0.org1.example.com
networks:
- byfn
cli:
container_name: cli
image: hyperledger/fabric-tools:$IMAGE_TAG
tty: true
stdin_open: true
environment:
- SYS_CHANNEL=$SYS_CHANNEL
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
#- FABRIC_LOGGING_SPEC=DEBUG
- FABRIC_LOGGING_SPEC=INFO
- CORE_PEER_ID=cli
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_TLS_ENABLED=true
- 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
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
- ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
- ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
- ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
depends_on:
- orderer.example.com
- peer0.org1.example.com
networks:
- byfn
4.host2.yaml
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
version: '2'
volumes:
orderer2.example.com:
peer1.org1.example.com:
networks:
byfn:
external:
name: first-network
services:
orderer2.example.com:
extends:
file: base/peer-base.yaml
service: orderer-base
container_name: orderer2.example.com
networks:
- byfn
volumes:
- ./channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer2.example.com/msp:/var/hyperledger/orderer/msp
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/:/var/hyperledger/orderer/tls
- orderer2.example.com:/var/hyperledger/production/orderer
ports:
- 7050:7050
peer1.org1.example.com:
container_name: peer1.org1.example.com
extends:
file: base/docker-compose-base.yaml
service: peer1.org1.example.com
networks:
- byfn
5.host3.yaml
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
version: '2'
volumes:
orderer3.example.com:
peer0.org2.example.com:
networks:
byfn:
external:
name: first-network
services:
orderer3.example.com:
extends:
file: base/peer-base.yaml
service: orderer-base
container_name: orderer3.example.com
networks:
- byfn
volumes:
- ./channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer3.example.com/msp:/var/hyperledger/orderer/msp
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/:/var/hyperledger/orderer/tls
- orderer3.example.com:/var/hyperledger/production/orderer
ports:
- 7050:7050
peer0.org2.example.com:
container_name: peer0.org2.example.com
extends:
file: base/docker-compose-base.yaml
service: peer0.org2.example.com
networks:
- byfn
6.host4.yaml
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
version: '2'
volumes:
orderer4.example.com:
peer1.org2.example.com:
networks:
byfn:
external:
name: first-network
services:
orderer4.example.com:
extends:
file: base/peer-base.yaml
service: orderer-base
container_name: orderer4.example.com
networks:
- byfn
volumes:
- ./channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer4.example.com/msp:/var/hyperledger/orderer/msp
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer4.example.com/tls/:/var/hyperledger/orderer/tls
- orderer4.example.com:/var/hyperledger/production/orderer
ports:
- 7050:7050
peer1.org2.example.com:
container_name: peer1.org2.example.com
extends:
file: base/docker-compose-base.yaml
service: peer1.org2.example.com
networks:
- byfn
My setup consists of three hosts each with one orderer and one peer with its accompanying CouchDB and client, for a total of at least four Docker containers on each host (one of them has an additional CA), deployed onto a Docker swarm.
When I encountered this problem in my setup, it was apparently due to ports not being open in my Docker swarm. This guide helped me in solving my problems. I hope it helps you too!
This error can occur on ubuntu 18. I fixed it by using ubuntu 16 on my VM
Sometimes it happens when you do things too fast: the Raft leader needs time to be elected. In my case, I employed a retry mechanism, and it would work after a few retries and sleeps.

Cannot run peer because error when setting up MSP of type bccsp from directory /etc/hyperledger/fabric/msp

I am learning to create an application using Hyperledger fabrics.
Created the network. I got an error when starting the network.
When I run command: docker-compose -f ./docker-compose.yml up
Getting error:
Cannot run peer because error when setting up MSP of type bccsp from directory /etc/hyperledger/fabric/msp: could not load a valid signer certificate from directory /etc/hyperledger/fabric/msp/signcerts: stat /etc/hyperledger/fabric/msp/signcerts: no such file or directory
I have already added the CORE_PEER_MSPCONFIGPATH property in CLI service #docker-compose.yml file
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/manufacturer.pharma-network.com/users/Admin#manufacturer.pharma-network.com/msp
This is my docker-compose.yml file.
version: '2'
volumes:
orderer.pharma-network.com:
peer0.manufacturer.pharma-network.com:
peer1.manufacturer.pharma-network.com:
peer0.distributor.pharma-network.com:
peer1.distributor.pharma-network.com:
peer0.retailer.pharma-network.com:
peer1.retailer.pharma-network.com:
peer0.consumer.pharma-network.com:
peer1.consumer.pharma-network.com:
peer0.transporter.pharma-network.com:
peer1.transporter.pharma-network.com:
networks:
pharma:
services:
ca.manufacturer.pharma-network.com:
image: hyperledger/fabric-ca:latest
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.manufacturer.pharma-network.com
- FABRIC_CA_SERVER_TLS_ENABLED=false
#- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.manufacturer.pharma-network.com-cert.pem
#- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/754fccf4ad3f6a483161cf597b79fbdbdadaf1ee2f024e79da8c8e9b8bfb6dcb_sk
ports:
- "7054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d' # --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.registrar.property-registration-network.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/754fccf4ad3f6a483161cf597b79fbdbdadaf1ee2f024e79da8c8e9b8bfb6dcb_sk
volumes:
- ./crypto-config/peerOrganizations/manufacturer.pharma-network.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca.manufacturer.pharma-network.com
networks:
- pharma
ca.distributor.pharma-network.com:
image: hyperledger/fabric-ca:latest
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.distributor.pharma-network.com
- FABRIC_CA_SERVER_TLS_ENABLED=false
# - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.users.property-registration-network.com-cert.pem
# - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/69f46c1ef51a71ee0aaadc9cef23aef7b44df2b1e84dad62484980170c01aa22_sk
ports:
- "8054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d' # --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.users.property-registration-network.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/69f46c1ef51a71ee0aaadc9cef23aef7b44df2b1e84dad62484980170c01aa22_sk
volumes:
- ./crypto-config/peerOrganizations/distributor.pharma-network.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca.distributor.pharma-network.com
networks:
- pharma
ca.retailer.pharma-network.com:
image: hyperledger/fabric-ca:latest
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.retailer.pharma-network.com
- FABRIC_CA_SERVER_TLS_ENABLED=false
# - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.users.property-registration-network.com-cert.pem
# - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/69f46c1ef51a71ee0aaadc9cef23aef7b44df2b1e84dad62484980170c01aa22_sk
ports:
- "9054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d' # --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.users.property-registration-network.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/69f46c1ef51a71ee0aaadc9cef23aef7b44df2b1e84dad62484980170c01aa22_sk
volumes:
- ./crypto-config/peerOrganizations/retailer.pharma-network.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca.retailer.pharma-network.com
networks:
- pharma
ca.consumer.pharma-network.com:
image: hyperledger/fabric-ca:latest
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.consumer.pharma-network.com
- FABRIC_CA_SERVER_TLS_ENABLED=false
ports:
- "1054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d' # --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.users.property-registration-network.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/69f46c1ef51a71ee0aaadc9cef23aef7b44df2b1e84dad62484980170c01aa22_sk
volumes:
- ./crypto-config/peerOrganizations/consumer.pharma-network.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca.consumer.pharma-network.com
networks:
- pharma
ca.transporter.pharma-network.com:
image: hyperledger/fabric-ca:latest
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.transporter.pharma-network.com
- FABRIC_CA_SERVER_TLS_ENABLED=false
# - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.users.property-registration-network.com-cert.pem
# - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/69f46c1ef51a71ee0aaadc9cef23aef7b44df2b1e84dad62484980170c01aa22_sk
ports:
- "2054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d' # --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.users.property-registration-network.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/69f46c1ef51a71ee0aaadc9cef23aef7b44df2b1e84dad62484980170c01aa22_sk
volumes:
- ./crypto-config/peerOrganizations/transporter.pharma-network.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca.transporter.pharma-network.com
networks:
- pharma
orderer.pharma-network.com:
extends:
file: docker-base/docker-compose-base.yaml
service: orderer.pharma-network.com
container_name: orderer.pharma-network.com
networks:
- pharma
peer0.manufacturer.pharma-network.com:
container_name: peer0.manufacturer.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer0.manufacturer.pharma-network.com
networks:
- pharma
peer1.manufacturer.pharma-network.com:
container_name: peer1.manufacturer.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer1.manufacturer.pharma-network.com
networks:
- pharma
peer0.distributor.pharma-network.com:
container_name: peer0.distributor.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer0.distributor.pharma-network.com
networks:
- pharma
peer1.distributor.pharma-network.com:
container_name: peer1.distributor.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer1.distributor.pharma-network.com
networks:
- pharma
peer0.retailer.pharma-network.com:
container_name: peer0.retailer.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer0.retailer.pharma-network.com
networks:
- pharma
peer1.retailer.pharma-network.com:
container_name: peer1.retailer.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer1.retailer.pharma-network.com
networks:
- pharma
peer0.consumer.pharma-network.com:
container_name: peer0.consumer.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer0.consumer.pharma-network.com
networks:
- pharma
peer1.consumer.pharma-network.com:
container_name: peer1.consumer.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer1.consumer.pharma-network.com
networks:
- pharma
peer0.transporter.pharma-network.com:
container_name: peer0.transporter.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer0.transporter.pharma-network.com
networks:
- pharma
peer1.transporter.pharma-network.com:
container_name: peer1.transporter.pharma-network.com
extends:
file: docker-base/docker-compose-base.yaml
service: peer1.transporter.pharma-network.com
networks:
- pharma
cli:
container_name: cli
image: hyperledger/fabric-tools:latest
tty: true
stdin_open: true
environment:
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- FABRIC_LOGGING_SPEC=INFO
- CORE_PEER_ID=cli
- CORE_PEER_ADDRESS=peer0.manufacturer.pharma-network.com:7051
- CORE_PEER_LOCALMSPID=manufacturerMSP
- CORE_PEER_TLS_ENABLED=false
- CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/manufacturer.pharma-network.com/peers/peer0.manufacturer.pharma-network.com/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/manufacturer.pharma-network.com/peers/peer0.manufacturer.pharma-network.com/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/manufacturer.pharma-network.com/peers/peer0.manufacturer.pharma-network.com/tls/ca.crt
- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/manufacturer.pharma-network.com/users/Admin#manufacturer.pharma-network.com/msp
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/hyperledger/fabric/peer/chaincode/
- ./../chaincode-advanced/:/opt/gopath/src/github.com/hyperledger/fabric/peer/chaincode-advanced/
- ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
- ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
- ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
depends_on:
- ca.manufacturer.pharma-network.com
- ca.distributor.pharma-network.com
- ca.retailer.pharma-network.com
- ca.consumer.pharma-network.com
- ca.transporter.pharma-network.com
- orderer.pharma-network.com
- peer0.manufacturer.pharma-network.com
- peer1.manufacturer.pharma-network.com
- peer0.distributor.pharma-network.com
- peer1.distributor.pharma-network.com
- peer0.retailer.pharma-network.com
- peer1.retailer.pharma-network.com
- peer0.consumer.pharma-network.com
- peer1.consumer.pharma-network.com
- peer0.transporter.pharma-network.com
- peer1.transporter.pharma-network.com
networks:
- pharma
chaincode:
container_name: chaincode
image: hyperledger/fabric-ccenv:latest
tty: true
environment:
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- FABRIC_LOGGING_SPEC=INFO
- CORE_PEER_ID=chaincode
- CORE_PEER_ADDRESS=peer0.manufacturer.pharma-network.com:7051
- CORE_PEER_LOCALMSPID=manufacturerMSP
- CORE_PEER_TLS_ENABLED=false
- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/crypto/peerOrganizations/manufacturer.pharma-network.com/users/Admin#manufacturer.pharma-network.com/msp
- CORE_TLS_CLIENT_KEY_PATH=/opt/gopath/src/crypto/peerOrganizations/manufacturer.pharma-network.com/users/Admin#manufacturer.pharma-network.com/tls/client.key
- CORE_TLS_CLIENT_CERT_PATH=/opt/gopath/src/crypto/peerOrganizations/manufacturer.pharma-network.com/users/Admin#manufacturer.pharma-network.com/tls/client.crt
- CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/crypto/peerOrganizations/manufacturer.pharma-network.com/users/Admin#manufacturer.pharma-network.com/tls/ca.crt
working_dir: /opt/gopath/src/chaincode
command: /bin/bash -c 'sleep 6000000'
volumes:
- /var/run/:/host/var/run/
- ./../chaincode:/opt/gopath/src/chaincode
- ./../chaincode-advanced:/opt/gopath/src/chaincode-advanced
- ./crypto-config:/opt/gopath/src/crypto
networks:
- pharma
This is docker-compose-base.yaml.
services:
orderer.pharma-network.com:
container_name: orderer.pharma-network.com
image: hyperledger/fabric-orderer:latest
environment:
- FABRIC_LOGGING_SPEC=INFO
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
# enable TLS
- ORDERER_GENERAL_TLS_ENABLED=false
- 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]
#- GODEBUG=netdns=go
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: orderer
volumes:
- ../channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
- ../crypto-config/ordererOrganizations/pharma-network.com/orderers/orderer.pharma-network.com/msp:/var/hyperledger/orderer/msp
- ../crypto-config/ordererOrganizations/pharma-network.com/orderers/orderer.pharma-network.com/tls/:/var/hyperledger/orderer/tls
- orderer.pharma-network.com:/var/hyperledger/production/orderer
ports:
- 7050:7050
peer0.manufacturer.pharma-network.com:
container_name: peer0.manufacturer.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.manufacturer.pharma-network.com
- CORE_PEER_ADDRESS=peer0.manufacturer.pharma-network.com:7051
- CORE_PEER_LISTENADDRESS=0.0.0.0:7051
- CORE_PEER_CHAINCODEADDRESS=peer0.manufacturer.pharma-network.com:7053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:7053
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.manufacturer.pharma-network.com:8051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.manufacturer.pharma-network.com:7051
- CORE_PEER_LOCALMSPID=manufacturerMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/manufacturer.pharma-network.com/peers/peer0.manufacturer.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/manufacturer.pharma-network.com/peers/peer0.manufacturer.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer0.manufacturer.pharma-network.com:/var/hyperledger/production
ports:
- 7051:7051
- 7053:7053
peer1.manufacturer.pharma-network.com:
container_name: peer1.manufacturer.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.manufacturer.pharma-network.com
- CORE_PEER_ADDRESS=peer1.manufacturer.pharma-network.com:8051
- CORE_PEER_LISTENADDRESS=0.0.0.0:8051
- CORE_PEER_CHAINCODEADDRESS=peer0.manufacturer.pharma-network.com:8053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:8053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.manufacturer.pharma-network.com:8051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.manufacturer.pharma-network.com:7051
- CORE_PEER_LOCALMSPID=manufacturerMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/manufacturer.pharma-network.com/peers/peer1.manufacturer.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/manufacturer.pharma-network.com/peers/peer1.manufacturer.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer1.manufacturer.pharma-network.com:/var/hyperledger/production
ports:
- 8051:8051
- 8053:8053
peer0.distributor.pharma-network.com:
container_name: peer0.distributor.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.distributor.pharma-network.com
- CORE_PEER_ADDRESS=peer0.distributor.pharma-network.com:9051
- CORE_PEER_LISTENADDRESS=0.0.0.0:9051
- CORE_PEER_CHAINCODEADDRESS=peer0.distributor.pharma-network.com:9053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:9053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.distributor.pharma-network.com:9051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.distributor.pharma-network.com:10051
- CORE_PEER_LOCALMSPID=distributorMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/distributor.pharma-network.com/peers/peer0.distributor.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/distributor.pharma-network.com/peers/peer0.distributor.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer0.distributor.pharma-network.com:/var/hyperledger/production
ports:
- 9051:9051
- 9053:9053
peer1.distributor.pharma-network.com:
container_name: peer1.distributor.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.distributor.pharma-network.com
- CORE_PEER_ADDRESS=peer1.distributor.pharma-network.com:10051
- CORE_PEER_LISTENADDRESS=0.0.0.0:10051
- CORE_PEER_CHAINCODEADDRESS=peer0.distributor.pharma-network.com:10053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:10053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.distributor.pharma-network.com:10051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.distributor.pharma-network.com:9051
- CORE_PEER_LOCALMSPID=distributorMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/distributor.pharma-network.com/peers/peer1.distributor.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/distributor.pharma-network.com/peers/peer1.distributor.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer1.distributor.pharma-network.com:/var/hyperledger/production
ports:
- 10051:10051
- 10053:10053
peer0.retailer.pharma-network.com:
container_name: peer0.retailer.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.retailer.pharma-network.com
- CORE_PEER_ADDRESS=peer0.retailer.pharma-network.com:11051
- CORE_PEER_LISTENADDRESS=0.0.0.0:11051
- CORE_PEER_CHAINCODEADDRESS=peer0.retailer.pharma-network.com:11053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:11053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.retailer.pharma-network.com:11051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.retailer.pharma-network.com:9051
- CORE_PEER_LOCALMSPID=retailerMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/retailer.pharma-network.com/peers/peer0.retailer.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/retailer.pharma-network.com/peers/peer0.retailer.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer0.retailer.pharma-network.com:/var/hyperledger/production
ports:
- 11051:11051
- 11053:11053
peer1.retailer.pharma-network.com:
container_name: peer1.retailer.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.retailer.pharma-network-network.com
- CORE_PEER_ADDRESS=peer1.retailer.pharma-network-network.com:11051
- CORE_PEER_LISTENADDRESS=0.0.0.0:11051
- CORE_PEER_CHAINCODEADDRESS=peer0.retailer.pharma-network-network.com:11053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:11053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.retailer.pharma-network-network.com:11051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.retailer.pharma-network.com:12051
- CORE_PEER_LOCALMSPID=upgradMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/retailer.pharma-network.com/peers/peer0.retailer.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/retailer.pharma-network.com/peers/peer0.retailer.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer0.retailer.pharma-network.com:/var/hyperledger/production
ports:
- 12051:12051
- 12053:12053
peer0.consumer.pharma-network.com:
container_name: peer0.consumer.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.consumer.pharma-network.com
- CORE_PEER_ADDRESS=peer0.consumer.pharma-network.com:12051
- CORE_PEER_LISTENADDRESS=0.0.0.0:12051
- CORE_PEER_CHAINCODEADDRESS=peer0.consumer.pharma-network.com:12053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:12053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.consumer.pharma-network.com:12051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.consumer.pharma-network.com:11051
- CORE_PEER_LOCALMSPID=consumerMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/consumer.pharma-network.com/peers/peer0.consumer.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/consumer.pharma-network.com/peers/peer0.consumer.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer0.consumer.pharma-network.com:/var/hyperledger/production
ports:
- 13051:13051
- 13053:13053
peer1.consumer.pharma-network.com:
container_name: peer1.consumer.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.consumer.pharma-network.com
- CORE_PEER_ADDRESS=peer1.consumer.pharma-network.com:12052
- CORE_PEER_LISTENADDRESS=0.0.0.0:12052
- CORE_PEER_CHAINCODEADDRESS=peer1.consumer.pharma-network.com:12054
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:12054
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.consumer.pharma-network.com:12052
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.consumer.pharma-network.com:11052
- CORE_PEER_LOCALMSPID=consumerMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/consumer.pharma-network.com/peers/peer1.consumer.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/consumer.pharma-network.com/peers/peer1.consumer.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer1.consumer.pharma-network.com:/var/hyperledger/production
ports:
- 14052:14052
- 14054:14054
peer0.transporter.pharma-network.com:
container_name: peer0.transporter.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.transporter.pharma-network.com
- CORE_PEER_ADDRESS=peer0.transporter.pharma-network.com:15051
- CORE_PEER_LISTENADDRESS=0.0.0.0:15051
- CORE_PEER_CHAINCODEADDRESS=peer0.transporter.pharma-network.com:15053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:15053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.transporter.pharma-network.com:15051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.transporter.pharma-network.com:16051
- CORE_PEER_LOCALMSPID=transporterMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/transporter.pharma-network.com/peers/peer0.transporter.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/transporter.pharma-network.com/peers/peer0.transporter.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer0.transporter.pharma-network.com:/var/hyperledger/production
ports:
- 15051:15051
- 15053:15053
peer1.transporter.pharma-network.com:
container_name: peer1.transporter.pharma-network.com
extends:
file: docker-compose-peer.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.transporter.pharma-network.com
- CORE_PEER_ADDRESS=peer1.transporter.pharma-network.com:16051
- CORE_PEER_LISTENADDRESS=0.0.0.0:16051
- CORE_PEER_CHAINCODEADDRESS=peer1.transporter.pharma-network.com:16053
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:16053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.transporter.pharma-network.com:16051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.transporter.pharma-network.com:15051
- CORE_PEER_LOCALMSPID=transporterMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/transporter.pharma-network.com/peers/peer1.transporter.pharma-network.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/transporter.pharma-network.com/peers/peer1.transporter.pharma-network.com/tls:/etc/hyperledger/fabric/tls
- peer1.transporter.pharma-network.com:/var/hyperledger/production
ports:
- 16051:16051
- 16053:16053
This is docker-compose-peer.yaml.
services:
peer-base:
image: hyperledger/fabric-peer:latest
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=network_pharma #changed this from network_certification
- FABRIC_LOGGING_SPEC=INFO
- CORE_PEER_TLS_ENABLED=false
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_PROFILE_ENABLED=true
- 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
volumes:
- ../crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: peer node start --peer-chaincodedev=true
Please help me.
I think you need you change ../crypto-config/peerOrganizations/manufacturer.pharma-network.com/peers/peer0.manufacturer.pharma-network.com/msp:/etc/hyperledger/fabric/msp to ./crypto-config/peerOrganizations/manufacturer.pharma-network.com/peers/peer0.manufacturer.pharma-network.com/msp:/etc/hyperledger/fabric/msp. This thing totally depends on your directory structure

My docker-compose.yml couldn't build mysql5.7 container

I'm trying to build docker container for laravel with docker-compose.yml.
I hove to build database container for mysql5.7.
Mysql8 cannot be used on my server witch connected.
There is my docker-compose.yml file.
version: "3"
services:
app:
build:
context: ./docker/php
args:
- TZ=${TZ}
ports:
- ${APP_PORT}:8000
volumes:
- ${PROJECT_PATH}:/work
- ./docker/ash:/etc/profile.d
- ./docker/php/psysh:/root/.config/psysh
- ./logs:/var/log/php
- ./docker/php/php.ini:/usr/local/etc/php/php.ini
working_dir: /work
environment:
- DB_CONNECTION=mysql
- DB_HOST=db
- DB_DATABASE=${DB_NAME}
- DB_USERNAME=${DB_USER}
- DB_PASSWORD=${DB_PASS}
- TZ=${TZ}
- MAIL_HOST=${MAIL_HOST}
- MAIL_PORT=${MAIL_PORT}
- CACHE_DRIVER=redis
- SESSION_DRIVER=redis
- QUEUE_DRIVER=redis
- REDIS_HOST=redis
web:
image: nginx:1.17-alpine
depends_on:
- app
ports:
- ${WEB_PORT}:80
volumes:
- ${PROJECT_PATH}:/work
- ./logs:/var/log/nginx
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
environment:
- TZ=${TZ}
db:
image: mysql:5.7
volumes:
- db-store:/var/lib/mysql
- ./logs:/var/log/mysql
- ./docker/mysql/my.cnf:/etc/mysql/conf.d/my.cnf
environment:
- MYSQL_DATABASE=${DB_NAME}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASS}
- MYSQL_ROOT_PASSWORD=${DB_PASS}
- TZ=${TZ}
ports:
- ${DB_PORT}:3306
db-testing:
image: mysql:5.7
volumes:
- ./docker/mysql/my.cnf:/etc/mysql/conf.d/my.cnf
tmpfs:
- /var/lib/mysql
- /var/log/mysql
environment:
- MYSQL_DATABASE=${DB_NAME}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASS}
- MYSQL_ROOT_PASSWORD=${DB_PASS}
- TZ=${TZ}
ports:
- ${DB_TESTING_PORT}:3306
node:
image: node:12.13-alpine
tty: true
volumes:
- ${PROJECT_PATH}:/work
working_dir: /work
redis:
image: redis:5.0-alpine
volumes:
- redis-store:/data
mail:
image: mailhog/mailhog
ports:
- ${MAILHOG_PORT}:8025
volumes:
db-store:
redis-store:
When I execute "docker-compose build" in terminal, it's successfully done, but db container and db-testing container has status "EXIT: 1" or "EXIT: 2".
So, Could you teach me what's wrong.

How to fix "The Compose file './docker-compose.yaml' is invalid because" error in Docker-Compose (Hyperledger Fabric)?

I am learning to code docker-compose.yaml in for Hyperledger Fabric. When I try running the command "docker-compose up", I get the following error:
The Compose file './docker-compose.yaml' is invalid because:
Additional properties are not allowed ('peer0.org2.example.com', 'peer1.org2.example.com' were unexpected)
You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version ("2.0", "2.1", "3.0") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
I am using docker-compose version 1.10.0, build 4bd6f1a
I have tried upgrading to different versions of docker-compose but none of them worked.
I also tried fixing the indentation.
version: "2"
networks:
default: null
services:
orderer.example.com:
image: 'hyperledger/fabric-orderer:x86_64-1.0.5'
container_name: orderer.example.com
environment:
- ORDERER_GENERAL_LOGLEVEL=debug
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_LISTENPORT=7050
- ORDERER_GENERAL_GENESISPROFILE=Example
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
- ORDERER_GENERAL_LOCALMSPID=example.com
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
- ORDERER_GENERAL_TLS_ENABLED=true
- 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]'
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: orderer
volumes:
- './channel-artifacts/orderer.genesis.block:/var/hyperledger/orderer/orderer.genesis.block'
- './crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp'
- './crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls:/var/hyperledger/orderer/tls'
ports:
- '7050:7050'
networks:
default:
aliases:
- orderer.example.com
ca.org1.example.com:
image: 'hyperledger/fabric-ca:x86_64-1.0.5'
container_name: ca.org1.example.com
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.org1.example.com
- FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
- FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/771ad840d46bfcfb4c523c7cf10039c09fc42571e7d305b66ae7f0dda954d78e_sk
- FABRIC_CA_SERVER_TLS_ENABLED=true
- 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/771ad840d46bfcfb4c523c7cf10039c09fc42571e7d305b66ae7f0dda954d78e_sk
ports:
- '7054:7054'
command: 'sh -c ''fabric-ca-server start -b admin:adminpw -d'''
volumes:
- './crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config'
networks:
default:
aliases:
- ca.org1.example.com
ca.org2.example.com:
image: 'hyperledger/fabric-ca:x86_64-1.0.5'
container_name: ca.org2.example.com
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.org2.example.com
- FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem
- FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/83b0a1364897e72470f73ebc018b8ea23ab8d310acb380831f8aa5207b6dc529_sk
- FABRIC_CA_SERVER_TLS_ENABLED=true
- 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/83b0a1364897e72470f73ebc018b8ea23ab8d310acb380831f8aa5207b6dc529_sk
ports:
- '8054:7054'
command: 'sh -c ''fabric-ca-server start -b admin:adminpw -d'''
volumes:
- './crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server-config'
networks:
default:
aliases:
- ca.org2.example.com
peer0.org1.example.com:
image: 'hyperledger/fabric-peer:x86_64-1.0.5'
container_name: peer0.org1.example.com
environment:
- 'CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock'
- CORE_VM_DOCKER_ATTACHSTDOUT=true
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_NETWORKID=Example
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/var/hyperledger/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/var/hyperledger/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/var/hyperledger/tls/ca.crt
- CORE_PEER_ID=peer0.org1.example.com
- CORE_PEER_ADDRESSAUTODETECT=true
- 'CORE_PEER_ADDRESS=peer0.org1.example.com:7051'
- 'CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051'
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_GOSSIP_SKIPHANDSHAKE=true
- CORE_PEER_LOCALMSPID=org1.example.com
- CORE_PEER_MSPCONFIGPATH=/var/hyperledger/msp
- CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer0.org1.example.com
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: 'peer node start'
volumes:
- '/var/run/:/host/var/run/'
- './crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/var/hyperledger/msp'
- './crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/var/hyperledger/tls'
ports:
- '7051:7051'
- '7053:7053'
depends_on:
- orderer.example.com
links:
- orderer.example.com
networks:
default:
aliases:
- peer0.org1.example.com
peer1.org1.example.com:
image: 'hyperledger/fabric-peer:x86_64-1.0.5'
container_name: peer1.org1.example.com
environment:
- 'CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock'
- CORE_VM_DOCKER_ATTACHSTDOUT=true
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_NETWORKID=Example
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/var/hyperledger/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/var/hyperledger/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/var/hyperledger/tls/ca.crt
- CORE_PEER_ID=peer1.org1.example.com
- CORE_PEER_ADDRESSAUTODETECT=true
- 'CORE_PEER_ADDRESS=peer1.org1.example.com:7051'
- 'CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051'
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_GOSSIP_SKIPHANDSHAKE=true
- CORE_PEER_LOCALMSPID=org1.example.com
- CORE_PEER_MSPCONFIGPATH=/var/hyperledger/msp
- CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer1.org1.example.com
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: 'peer node start'
volumes:
- '/var/run/:/host/var/run/'
- './crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/var/hyperledger/msp'
- './crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls:/var/hyperledger/tls'
ports:
- '8051:7051'
- '8053:7053'
depends_on:
- orderer.example.com
links:
- orderer.example.com
networks:
default:
aliases:
- peer1.org1.example.com
peer0.org2.example.com:
image: 'hyperledger/fabric-peer:x86_64-1.0.5'
container_name: peer0.org2.example.com
environment:
- 'CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock'
- CORE_VM_DOCKER_ATTACHSTDOUT=true
- CORE_LOGGING_LEVEL=DEBUG
- 'CORE_PEER_NETWORKID= Example'
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/var/hyperledger/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/var/hyperledger/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/var/hyperledger/tls/ca.crt
- CORE_PEER_ID=peer0.org2.example.com
- CORE_PEER_ADDRESSAUTODETECT=true
- 'CORE_PEER_ADDRESS=peer0.org2.example.com:7051'
- 'CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051'
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_GOSSIP_SKIPHANDSHAKE=true
- CORE_PEER_LOCALMSPID=org2.example.com
- CORE_PEER_MSPCONFIGPATH=/var/hyperledger/msp
- CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer0.org2.example.com
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: 'peer node start'
volumes:
- '/var/run/:/host/var/run/'
- './crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp:/var/hyperledger/msp'
- './crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls:/var/hyperledger/tls'
ports:
- '9051:7051'
- '9053:7053'
depends_on:
- orderer.example.com
links:
- orderer.example.com
networks:
default:
aliases:
- peer0.org2.example.com
peer1.org2.example.com:
image: 'hyperledger/fabric-peer:x86_64-1.0.5'
container_name: peer1.org2.example.com
environment:
- 'CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock'
- CORE_VM_DOCKER_ATTACHSTDOUT=true
- CORE_LOGGING_LEVEL=DEBUG
- 'CORE_PEER_NETWORKID= Example'
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/var/hyperledger/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/var/hyperledger/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/var/hyperledger/tls/ca.crt
- CORE_PEER_ID=peer1.org2.example.com
- CORE_PEER_ADDRESSAUTODETECT=true
- 'CORE_PEER_ADDRESS=peer1.org2.example.com:7051'
- 'CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org2.example.com:7051'
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_GOSSIP_SKIPHANDSHAKE=true
- CORE_PEER_LOCALMSPID=org2.example.com
- CORE_PEER_MSPCONFIGPATH=/var/hyperledger/msp
- CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer1.org2.example.com
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: 'peer node start'
volumes:
- '/var/run/:/host/var/run/'
- './crypto-config/peerOrganizations/org2.example.com/
peers/peer1.org2.example.com/msp:/var/hyperledger/msp'
- './crypto-config/peerOrganizations/org2.example.com/peers/
peer1.org2.example.com/tls:/var/hyperledger/tls'
ports:
- '10051:7051'
- '10053:7053'
depends_on:
- orderer.example.com
links:
- orderer.example.com
networks:
default:
aliases:
- peer1.org2.example.com

Cannot start service peer0.org1.firstproject.com: b'OCI runtime create failed:

I'm trying to create my own-network in hyperledger fabric but got stuck because of below reason. I'm following chainHero tutorial for this with some changes like using my own organization name and peer's name.
I have already tried a couple of solutions available but none of them worked for me hence asking this question. Any help would be appreciated.
Error
docker-compose up -d
Creating network "firstproject-network_default" with the default driver
Creating ca.org1.firstproject.com ... done
Creating orderer.firstproject.com ... done
Creating peer1.org1.firstproject.com ... error
Creating peer0.org1.firstproject.com ...
Cannot start service peer0.org1.firstproject.com: b'OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \\"peer\\": executable file not found in $PATH": unknown'
Docker-compose.yaml file
version: '2'
networks:
default:
services:
orderer.firstproject.com:
container_name: orderer.firstproject.com
extends:
file: peer-base.yaml
service: orderer-base
environment:
- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
- GRPC_TRACE=all=true,
- GRPC_VERBOSITY=debug
volumes:
- ./crypto-config/ordererOrganizations/firstproject.com/msp:/var/hyperledger/orderer/msp
- ./artifacts/genesis.block:/var/hyperledger/orderer/genesis.block
- ./crypto-config/ordererOrganizations/firstproject.com/orderers/orderer.firstproject.com/tls:/var/hyperledger/orderer/tls
ports:
- 7050:7050
ca.org1.firstapplication.com:
image: hyperledger/fabric-ca:latest
container_name: ca.org1.firstproject.com
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.org1.firstproject.com
- FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.firstproject.com-cert.pem
- FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/78da3186373e52832b71dd83ec4d36ef84722a3e3ed15e8df214b482fe2723e7_sk
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.firstproject.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/78da3186373e52832b71dd83ec4d36ef84722a3e3ed15e8df214b482fe2723e7_sk
ports:
- 7054:7054
command: sh -c 'fabric-ca-server start -b admin:adminpw -d'
volumes:
- ./crypto-config/peerOrganizations/org1.firstproject.com/ca/:/etc/hyperledger/fabric-ca-server-config
peer0.org1.firstproject.com:
container_name: peer0.org1.firstproject.com
extends:
file: peer-base.yaml
service: peer-base
environment:
- CORE_PEER_NETWORKID=firstproject
- CORE_PEER_ID=peer0.org1.firstproject.com
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_PEER_ADDRESS=peer0.org1.firstproject.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.firstproject.com:7051
- CORE_PEER_GOSSIP_SKIPHANDSHAKE=true
- CORE_PEER_LOCALMSPID=org1.firstproject.com
- CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer0.org1.firstproject.com
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/org1.firstproject.com/peers/peer0.org1.firstproject.com/msp:/var/hyperledger/msp
- ./crypto-config/peerOrganizations/org1.firstproject.com/peers/peer0.org1.firstproject.com/tls:/var/hyperledger/tls
ports:
- 7051:7051
- 7053:7053
depends_on:
- orderer.firstproject.com
links:
- orderer.firstproject.com
networks:
default:
aliases:
- peer0.org1.firstproject.com
peer1.org1.firstproject.com:
container_name: peer1.org1.firstproject.com
extends:
file: peer-base.yaml
service: peer-base
environment:
- CORE_PEER_NETWORKID=firstproject
- CORE_PEER_ID=peer1.org1.firstproject.com
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_PEER_ADDRESS=peer1.org1.firstproject.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.firstproject.com:7051
- CORE_PEER_GOSSIP_SKIPHANDSHAKE=true
- CORE_PEER_LOCALMSPID=org1.firstproject.com
- CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer1.org1.firstproject.com
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/org1.firstproject.com/peers/peer1.org1.firstproject.com/msp:/var/hyperledger/msp
- ./crypto-config/peerOrganizations/org1.firstproject.com/peers/peer1.org1.firstproject.com/tls:/var/hyperledger/tls
ports:
- 8051:7051
- 8053:7053
depends_on:
- orderer.firstproject.com
links:
- orderer.firstproject.com
networks:
default:
aliases:
- peer1.org1.firstproject.com
Peer-base.yaml ##
version: '2'
services:
peer-base:
image: hyperledger/fabric-orderer:latest
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_VM_DOCKER_ATTACHSTDOUT=true
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/var/hyperledger/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/var/hyperledger/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/var/hyperledger/tls/ca.crt
- CORE_PEER_MSPCONFIGPATH=/var/hyperledger/msp
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: peer node start
orderer-base:
image: hyperledger/fabric-orderer:latest
environment:
- FABRIC_LOGGING_SPEC=DEBUG
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
# enabled TLS
- ORDERER_GENERAL_TLS_ENABLED=true
- 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]
- ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/var/hyperledger/orderer/tls/server.crt
- ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/var/hyperledger/orderer/tls/server.key
- ORDERER_GENERAL_CLUSTER_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: orderer
Your definition of peer-base is incorrect
services:
peer-base:
image: hyperledger/fabric-orderer:latest
your image should be fabric-peer
services:
peer-base:
image: hyperledger/fabric-peer:latest
Would also highly recommend you don't use the latest tag as this tag will be removed in the future. You should specify the version you want to use.

Resources