Hyperledger fabric HyperLedger结构E2E方案不起作用

Hyperledger fabric HyperLedger结构E2E方案不起作用,hyperledger-fabric,hyperledger,hyperledger-fabric-ca,Hyperledger Fabric,Hyperledger,Hyperledger Fabric Ca,我想使用end-2-end场景构建我的第一个网络来调用证书颁发机构容器。因此,我刚刚用docker compose e2e替换了docker compose cli yaml文件 # use this as the default docker-compose yaml definition #COMPOSE_FILE=docker-compose-cli.yaml COMPOSE_FILE=docker-compose-e2e.yaml 但是,当我尝试启动此网络时,出现以下错误: cli c

我想使用end-2-end场景构建我的第一个网络来调用证书颁发机构容器。因此,我刚刚用docker compose e2e替换了docker compose cli yaml文件

# use this as the default docker-compose yaml definition
#COMPOSE_FILE=docker-compose-cli.yaml
COMPOSE_FILE=docker-compose-e2e.yaml
但是,当我尝试启动此网络时,出现以下错误:

cli container not found

为什么它调用CLI容器。任何人都可以解释一下使用e2e docker compose设置此网络需要遵循的步骤。

这就是docker-compose-e2e.yaml的问题所在。要运行e2e测试,我们需要cli容器,但在
docker-compose-e2e.yaml
中没有提到启动cli容器的服务

启动
/byfn.sh up-s couchdb-f docker-compose-e2e.yaml时,它将启动对等方、couchdb、订购方容器,但无法启动cli容器。因为它们没有cli容器的配置

要解决这个问题,只需在docker-compose-e2e.yaml中添加cli服务配置

  cli:
    container_name: cli
    image: hyperledger/fabric-tools:$IMAGE_TAG
    tty: true
    stdin_open: true
    environment:
      - SYS_CHANNEL=$SYS_CHANNEL
      - GOPATH=/opt/gopath
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      #- FABRIC_LOGGING_SPEC=DEBUG
      - FABRIC_LOGGING_SPEC=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:
      - orderer.example.com
      - peer0.org1.example.com
      - peer1.org1.example.com
      - peer0.org2.example.com
      - peer1.org2.example.com
    networks:
      - byfn
现在启动
/byfn.sh up-s couchdb-f docker-compose-e2e.yaml
。它将运行e2e测试


我希望这会有所帮助。

这就是docker-compose-e2e.yaml的问题所在。要运行e2e测试,我们需要cli容器,但在
docker-compose-e2e.yaml
中没有提到启动cli容器的服务

启动
/byfn.sh up-s couchdb-f docker-compose-e2e.yaml时,它将启动对等方、couchdb、订购方容器,但无法启动cli容器。因为它们没有cli容器的配置

要解决这个问题,只需在docker-compose-e2e.yaml中添加cli服务配置

  cli:
    container_name: cli
    image: hyperledger/fabric-tools:$IMAGE_TAG
    tty: true
    stdin_open: true
    environment:
      - SYS_CHANNEL=$SYS_CHANNEL
      - GOPATH=/opt/gopath
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      #- FABRIC_LOGGING_SPEC=DEBUG
      - FABRIC_LOGGING_SPEC=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:
      - orderer.example.com
      - peer0.org1.example.com
      - peer1.org1.example.com
      - peer0.org2.example.com
      - peer1.org2.example.com
    networks:
      - byfn
现在启动
/byfn.sh up-s couchdb-f docker-compose-e2e.yaml
。它将运行e2e测试


我希望这会有所帮助。

docker-compose-e2e.yaml是为SDK而设计的,不使用CLI容器。这些文档告诉您如何使用e2e->我阅读了本文档,但这并没有详细说明本节内容。那么docker将在哪个容器上编写这个e2e yaml文件呢?我是hyperledger光纤技术的新手。你能告诉我(1)cli和e2e之间的区别吗?(2) 如何使用e2e设置网络?(3) 为什么CLI中没有ca容器?证书验证和其他工作是如何执行的?嗨1)其中一个区别是e2e在2-org设置中使用CA docker容器,而CLI yaml(
docker compose CLI.yaml
,BYFN中的默认yaml)没有:-)2)参见下面的最后一条评论3)上面已经解释过。要启动e2e yaml,您只需运行(在命令行上)类似的操作(从您克隆的fabric示例中的第一个网络目录):
/byfn.sh up-c mychannel-f docker-compose-e2e.yaml-s couchdb
(在首先按照文档获取二进制文件后,使用工具(例如cryptogen))然后运行cmddocker-compose-e2e.yaml是为SDK而设计的,不使用CLI容器。这些文档告诉您如何使用e2e->我阅读了本文档,但这并没有详细说明本节内容。那么docker将在哪个容器上编写这个e2e yaml文件呢?我是hyperledger光纤技术的新手。你能告诉我(1)cli和e2e之间的区别吗?(2) 如何使用e2e设置网络?(3) 为什么CLI中没有ca容器?证书验证和其他工作是如何执行的?嗨1)其中一个区别是e2e在2-org设置中使用CA docker容器,而CLI yaml(
docker compose CLI.yaml
,BYFN中的默认yaml)没有:-)2)参见下面的最后一条评论3)上面已经解释过。要启动e2e yaml,您只需运行(在命令行上)类似的东西(从您克隆的fabric示例中的第一个网络目录):
/byfn.sh up-c mychannel-f docker-compose-e2e.yaml-s couchdb
(在首先跟随文档获取二进制文件后,使用工具(例如cryptogen)),然后运行cmd