0

我一直在向我的超级账本结构网络添加几个组织。我正在使用具有以下 CLI 配置的结构 1.4.1:

    container_name: cli-org1
    image: hyperledger/fabric-tools:1.4.1
    tty: true
    environment:
      - GOPATH=/opt/gopath
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      - FABRIC_LOGGING_SPEC=debug
      - CORE_PEER_ID=peer0.org1.example.com
      - CORE_PEER_TLS_ENABLED=true
      - CORE_PEER_LOCALMSPID=Org1MSP
      - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/org1.example.com/users/Admin@org1.example.com/msp
      - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
      # Certs
      - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
      - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/org1.example.com/peers/peer0.org1.example.com/tls/server.key
      - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
      # Chaincode
      - CORE_CHAINCODE_KEEPALIVE=10
      # Orderer
      - ORDERER_CA=/etc/hyperledger/msp/orderer/tlscacerts/tlsca.example.com-cert.pem
    working_dir: /opt/gopath/src/
    command: /bin/bash
    volumes:
      - /var/run/:/host/var/run/
      - ./../chaincode/:/opt/gopath/src/chaincode/
      - ./crypto-config/peerOrganizations:/etc/hyperledger
      - ./crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/etc/hyperledger/msp/orderer
    networks:
      - basic 

所有的 Orgs peers、orderes 和 couchDBs 都已经启动了,但是当我想在 cli-org1 中安装链代码时:

   peer chaincode install \
   --lang node \
   --name Contract \
   --version 0.1.0 \
   --path chaincode \
   --tls --cafile ${ORDERER_CA}

我收到以下错误:

ERRO 001 Fatal error when initializing core config : Could not find config file. Please make sure that FABRIC_CFG_PATH is set to a path which contains core.yaml

我觉得core.yaml默认是在docker容器里面的,能告诉我配置有没有错误吗?

问候。

4

1 回答 1

0

您需要在对等配置中使用以下环境变量。- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${COMPOSE_PROJECT_NAME}_basic

于 2020-01-27T10:37:25.417 回答