【问题标题】:Error installing chaincode in several organizations in Hyperledger Fabric network. Could not find config file在 Hyperledger Fabric 网络中的多个组织中安装链码时出错。找不到配置文件
【发布时间】:2020-01-24 12:04:22
【问题描述】:

我一直在向我的超级账本结构网络添加几个组织。我正在使用具有以下 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容器里面的,能告诉我配置有没有错误吗?

问候。

【问题讨论】:

    标签: hyperledger-fabric hyperledger hyperledger-chaincode chaincode


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-25
      • 1970-01-01
      • 1970-01-01
      • 2021-05-19
      • 2020-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多