TLS握手失败,并显示错误远程错误:tls:错误的证书服务器=订购者remoteaddress = 192.168.1.249:35230

时间:2019-11-18 15:32:33

标签: docker hyperledger-fabric hyperledger

我正在尝试在多台机器上部署hyperledger fabric(v1.4.3)独占模式,role-ip映射如下:

orderer          192.168.1.251
peer0.org1       192.168.1.249
peer0.org2       192.168.1.248
peer1.org1       192.168.1.247
peer1.org2       192.168.1.246

我将fabric-samples/first-network复制到first,并删除一些文件,first文件夹包含:

├── base
│   ├── docker-compose-base.yaml
│   └── peer-base.yaml
├── channel-artifacts
├── configtx.yaml
├── crypto-config.yaml
├── docker-compose-cli.yaml
    byfn.sh

我将crypto-config.yamlconfigtx.yaml保持与fabric-samples相同,只是更改docker-compose-cli.yaml

orderer的{​​{1}}:

docker-compose-cli.yaml

# Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 # version: '2' volumes: orderer.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 的{​​{1}}:

peer0.org1

其他同伴随着上述yaml文件中的注释而更改。我使用docker-compose-cli.yaml在每个对等方和订购者上生成通道工件,然后在peer0.org1(192.168.1.249)cli容器中,我成功安装了链码,但是当我实例化链码时,我看到了订购者控制台抛出错误:

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

version: '2'

volumes:
  peer0.org1.example.com:

networks:
  byfn:

services:

  peer0.org1.example.com:
    container_name: peer0.org1.example.com
    extends:
      file:  base/docker-compose-base.yaml
      service: peer0.org1.example.com
    networks:
      - byfn
    extra_hosts:
      - "orderer.example.com:192.168.1.251"
      - "peer1.org1.example.com:192.168.1.247"
      - "peer0.org2.example.com:192.168.1.248"
      - "peer1.org2.example.com:192.168.1.246"

  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             # change in different peer
      - CORE_PEER_LOCALMSPID=Org1MSP                              # change in different peer
      - 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      # change in different peer and org
      - 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       # change in different peer and org
      - 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      # change in different peer and org
      - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp      # change in different org
    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:
      - peer0.org1.example.com
    networks:
      - byfn
    extra_hosts:
      - "orderer.example.com:192.168.1.251"
      - "peer0.org1.example.com:192.168.1.249"
      - "peer1.org1.example.com:192.168.1.247"
      - "peer0.org2.example.com:192.168.1.248"
      - "peer1.org2.example.com:192.168.1.246"

并且我注意到同行之间也发生了错误,我已经尝试了几种来自互联网的方法,但是都失败了。有人可以帮我吗?欢迎任何以kafka模式部署Hyperledger Fabric的教程!

最好的问候!

1 个答案:

答案 0 :(得分:0)

最后,我通过创建-channelID mychannel时删除了genesis.block参数来解决了这个问题。我不知道为什么,所以如果有任何建议,请在这里评论。