Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hyperledger fabric 如何修复尝试启动第一个网络时出现的错误_Hyperledger Fabric - Fatal编程技术网

Hyperledger fabric 如何修复尝试启动第一个网络时出现的错误

Hyperledger fabric 如何修复尝试启动第一个网络时出现的错误,hyperledger-fabric,Hyperledger Fabric,我正在使用Hyperledger Fabric 1.3.0。当我在fabric samples/first网络中执行“byfn.sh-m up”时,出现以下错误 正在启动通道“mychannel”,CLI超时为“10”秒,CLI延迟为“3”秒 继续?[Y/n]Y 诉讼程序 本地_版本=1.3.0 DOCKER_图像_版本=1.3.0 错误:没有这样的容器:cli 错误!!!!测试失败 请帮忙 我没有docker-compose.yaml,但我有docker-compose-cli.yaml。内容

我正在使用Hyperledger Fabric 1.3.0。当我在fabric samples/first网络中执行“byfn.sh-m up”时,出现以下错误

正在启动通道“mychannel”,CLI超时为“10”秒,CLI延迟为“3”秒 继续?[Y/n]Y 诉讼程序 本地_版本=1.3.0 DOCKER_图像_版本=1.3.0 错误:没有这样的容器:cli 错误!!!!测试失败

请帮忙


我没有docker-compose.yaml,但我有docker-compose-cli.yaml。内容如下:

# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

version: '2'

volumes:
  orderer.example.com:
  peer0.org1.example.com:
  peer1.org1.example.com:
  peer0.org2.example.com:
  peer1.org2.example.com:

networks:
  byfn:

services:

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

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

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

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

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

  cli:
    container_name: cli
    image: hyperledger/fabric-tools:$IMAGE_TAG
    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.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:`enter code here`
      - orderer.example.com
      - peer0.org1.example.com
      - peer1.org1.example.com
      - peer0.org2.example.com
      - peer1.org2.example.com
    networks:
      - byfn

嗯,看来您的版本有一些问题,我建议您清理docker运行的所有容器和图像:

docker rmi $(docker images -a -q) //for images

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q) //for containers
之后,重新下载fabric示例,我认为他们昨天更新了1.3.0稳定版本,再次设置您的crytogen路径(如果您指向的是cryptogen工具的旧版本,这一点非常重要,它将无法工作

再试一次,如果不行,我建议你给我们更多的信息,比如

你在哪里运行你的第一个网络?Windows?Mac?Linux? Linux版本?docker版本

如果您仍然有问题,您可以查看我的指南,了解如何使用基本网络示例从头开始设置hyperledger结构,这很简单,可以解释您需要的所有概念

更新

因为您在Windows中,所以不要使用用户文件夹,创建一个简单的文件夹结构,例如C:/HLF

然后在.env文件中添加这一行
COMPOSE\u CONVERT\u WINDOWS\u path=1
。 这有助于docker理解windows路径,因为它们在linux中是不同的

更新#2

然后,让我们尝试另一种解决方案,转到脚本文件夹中的script.sh,查找命令
对等通道创建…
,并在IF语句前面添加这一行,它们
MSYS\u NO\u PATHCONV=1

查看fabric解决方案中的Windows Extras部分,检查您是否已全部安装

然后重新生成所有内容。在我的第一个答案中运行docker命令并添加这个

docker network prune
在那之后

./byfn.sh down
./byfn.sh generate
./byfn.sh -m up
更新#3

我使用Windows 10和Docker for Windows(使用linux容器)以及我前面提到的配置测试了First网络,它运行良好

我的docker版本是:18.06.1-ce

我学习了Fabric Hyperledger官方教程:

我看到的唯一区别是我运行了
/byfn.sh up
,而不是
/byfn.sh-m up

我建议您重新安装docker for windows,可能是因为它已损坏,不允许您启动网络


希望能有所帮助!

我按照您的建议删除了所有图像。我没有运行任何容器。我仍然有相同的问题。我在WLS(Windows Linux子系统)中的Windows 10上运行使用Docker版本18.06.1-ceI按照您的建议添加到.env文件中。我的文件夹结构是c:\workspace\fabric samples\first network。我仍然有相同的问题。您可以将Docker-compose.yaml添加到问题中吗?我没有Docker-compose.yaml,但我有Docker-compose-cli.yaml。我已经将它添加到我的问题中了t仍然不能工作。我仍然会遇到同样的错误。如果有人能让它在Windows 10上工作,请告诉我。我已经花了2天时间,但无法让它工作。我已经放弃了。我要给自己买一台Mac电脑。