无法在Hyperledger架构docker设置中创建频道?

时间:2019-01-18 14:18:34

标签: docker hyperledger-fabric

问题:

我对Hyperledger面料产品非常陌生。我尝试使用docker从头开始构建网络。一切正常,网络成功建立。但是当我尝试创建频道时,却出现了此错误。

2019-01-18 09:34:00.275 UTC [msp] getMspConfig -> WARN 001 Intermediate certs folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/Policedepartment.trafficfine.com/users/Admin@Policedepartment.trafficfine.com/msp/intermediatecerts]. Skipping. [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/Policedepartment.trafficfine.com/users/Admin@Policedepartment.trafficfine.com/msp/intermediatecerts: no such file or directory]
2019-01-18 09:34:00.288 UTC [msp] getMspConfig -> WARN 002 TLS intermediate certs folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/Policedepartment.trafficfine.com/users/Admin@Policedepartment.trafficfine.com/msp/tlsintermediatecerts]. Skipping. [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/Policedepartment.trafficfine.com/users/Admin@Policedepartment.trafficfine.com/msp/tlsintermediatecerts: no such file or directory]
2019-01-18 09:34:00.289 UTC [msp] getMspConfig -> WARN 003 crls folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/Policedepartment.trafficfine.com/users/Admin@Policedepartment.trafficfine.com/msp/crls]. Skipping. [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/Policedepartment.trafficfine.com/users/Admin@Policedepartment.trafficfine.com/msp/crls: no such file or directory]
2019-01-18 09:34:00.291 UTC [msp] getMspConfig -> INFO 004 MSP configuration file not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/Policedepartment.trafficfine.com/users/Admin@Policedepartment.trafficfine.com/msp/config.yaml]: [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/Policedepartment.trafficfine.com/users/Admin@Policedepartment.trafficfine.com/msp/config.yaml: no such file or directory]
Error: Error connecting due to  rpc error: code = Unavailable desc = grpc: the connection is unavailable

这是我的docker-compose-cli.yaml文件。

    version: "2"

    volumes:
      orderer.trafficfine.com:
      peer0.Mp.trafficfine.com:
      peer1.Mp.trafficfine.com:
      peer0.Policedepartment.trafficfine.com:
      peer1.Policedepartment.trafficfine.com:
      peer0.AE.trafficfine.com:
      peer1.AE.trafficfine.com:

    networks:
      byfn:

    services:
      orderer.trafficfine.com:
        extends:
          file: base/docker-compose-base.yaml
          service: orderer.trafficfine.com
        container_name: orderer.trafficfine.com
        networks:
          - byfn

      peer0.Mp.trafficfine.com:
        container_name: peer0.Mp.trafficfine.com
        extends:
          file: base/docker-compose-base.yaml
          service: peer0.Mp.trafficfine.com
        networks:
          - byfn

      peer1.Mp.trafficfine.com:
        container_name: peer1Mp.trafficfine.com
        extends:
          file: base/docker-compose-base.yaml
          service: peer1.Mp.trafficfine.com
        networks:
          - byfn

      peer0.Policedepartment.trafficfine.com:
        container_name: peer0.Policedepartment.trafficfine.com
        extends:
          file: base/docker-compose-base.yaml
          service: peer0.Policedepartment.trafficfine.com
        networks:
          - byfn

      peer1.Policedepartment.trafficfine.com:
        container_name: peer1.Policedepartment.trafficfine.com
        extends:
          file: base/docker-compose-base.yaml
          service: peer1.Policedepartment.trafficfine.com
        networks:
          - byfn

      peer0.AE.trafficfine.com:
        container_name: peer0.AE.trafficfine.com
        extends:
          file: base/docker-compose-base.yaml
          service: peer0.AE.trafficfine.com
        networks:
          - byfn

      peer1.AE.trafficfine.com:
        container_name: peer1.AE.trafficfine.com
        extends:
          file: base/docker-compose-base.yaml
          service: peer1.AE.trafficfine.com
        networks:
          - byfn

      cli:
        container_name: cli
        image: hyperledger/fabric-tools:x86_64-1.0.0-rc1
        tty: true
        stdin_open: true
        environment:
          - GOPATH=/opt/gopath
          - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
          #- CORE_LOGGING_LEVEL=DEBUG
          - CORE_LOGGING_LEVEL=INFO
          - CORE_PEER_ID=cli
          - CORE_PEER_ADDRESS=peer0.Msp.trafficfine.com:7051
          - CORE_PEER_LOCALMSPID=MpMSP
          - CORE_PEER_TLS_ENABLED=true
          - CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/Mp.trafficfine.com/peers/peer0.Mp.trafficfine.com/tls/server.crt
          - CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/Mp.trafficfine.com/peers/peer0.Mp.trafficfine.com/tls/server.key
          - CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/Policedepartment.trafficfine.com/peers/peer0.Policedepartment.trafficfine.com/tls/ca.crt
          - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/Policedepartment.trafficfine.com/users/Admin@Policedepartment.trafficfine.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.trafficfine.com
          - peer0.Mp.trafficfine.com
          - peer1.Mp.trafficfine.com
          - peer0.Policedepartment.trafficfine.com
          - peer1.Policedepartment.trafficfine.com
          - peer0.AE.trafficfine.com
          - peer1.AE.trafficfine.com
        networks:
          - byfn

我在Internet上寻找解决方案,但是找不到解决我问题的好的方法。有人可以帮助我解决我的问题吗?谢谢!

2 个答案:

答案 0 :(得分:0)

您是否生成了新的加密材料? 试试这个:

  

docker container exec -it cli bash

然后搜索crypto目录,该错误表明未在容器中找到您的加密资料文件,因此您需要它来通过网络进行交易。

答案 1 :(得分:0)

@dwp,根据您的卷将计算机中的源目录(“ ./crypto-config”)安装到容器(“ /opt/gopath/src/github.com/hyperledger/fabric/peer/ crypto /")...

错误提示(让我们先看一个) ==>在/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/Policedepartment.trafficfine.com/users/Admin@Policedepartment.trafficfine.com/msp/intermediatecerts <上找不到中间证书文件夹/ p>

表示没有目录“ ./crypto-config/peerOrganizations/Policedepartment.trafficfine.com/users/Admin@Policedepartment.trafficfine.com/msp/intermediatecerts”。

因此,请尝试根据您的crypto-config文件更改卷装入源和目标。

要进一步调试cli容器的使用情况,

  
    

docker exec -it cli bash