在Hyperledger Fabric网络中的多个组织中安装链码时出错。找不到配置文件

问题描述 投票:0回答:1

我已经在我的超级账本结构网络中添加了多个组织。我正在使用具有以下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/[email protected]/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的同级,订单和couchDB都已建立,但是当我想使用以下命令在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容器内,您能告诉我配置是否存在错误吗?

问候

hyperledger-fabric hyperledger hyperledger-chaincode chaincode
1个回答
0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.