我的设置如下:
我实际上如何运行Fabric网络:
尝试使主机2中的对等方加入通道时出现我的问题。我正在尝试通过主机1上的cli将它们添加到频道中。
但是我收到以下错误:
Error: error getting endorser client for channel: endorser client failed to connect to peer0.sponsor.example.com:7051: failed to create new connection: context deadline exceeded
这是我的主机1的docker-compose-cli.yaml:
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
version: '2'
volumes:
orderer.example.com:
peer0.manager.example.com:
peer1.manager.example.com:
peer0.sponsor.example.com:
peer1.sponsor.example.com:
networks:
example:
services:
orderer.example.com:
extends:
file: base/docker-compose-base-1.yaml
service: orderer.example.com
container_name: orderer.example.com
networks:
- example
peer0.manager.example.com:
container_name: peer0.manager.example.com
extends:
file: base/docker-compose-base-1.yaml
service: peer0.manager.example.com
networks:
- example
peer1.manager.example.com:
container_name: peer1.manager.example.com
extends:
file: base/docker-compose-base-1.yaml
service: peer1.manager.example.com
networks:
- example
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.manager.example.com:7051
- CORE_PEER_LOCALMSPID=ManagerMSP
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/manager.example.com/peers/peer0.manager.example.com/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/manager.example.com/peers/peer0.manager.example.com/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/manager.example.com/peers/peer0.manager.example.com/tls/ca.crt
- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/manager.example.com/users/Admin@manager.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.manager.example.com
- peer1.manager.example.com
networks:
- example
答案 0 :(得分:0)
该节点无法连接到 peer0.sponsor.proa.com 。这可能是由于您根据自己的喜好自定义网络地址所做的一些更改,这是您自定义的吗?我没有遵循本教程,但是在遵循this one的同时自定义第一个网络示例时遇到了一些类似的问题。
确保在 configtx.yaml,cryptoconfig.yaml , docker-compose-cli.yaml 和 docker-compose- base.yaml 和 peer-base.yaml (如果您更改了网络名称)。
如果这些文件的对等方地址未检出,则您可能需要再次生成通道事务并重新启动网络,因为区块链中存在的通道配置与您当前的通道配置不匹配网络配置。
答案 1 :(得分:0)
我犯了一个非常简单的错误:我没有将生成的加密材料从一台主机复制到另一台主机;我当时正在所有主机上生成新的加密材料,以为它们将是相同的。