hyperledger / fabric

Hyperledger Fabric is an enterprise-grade permissioned distributed ledger framework for developing solutions and applications. Its modular and versatile design satisfies a broad range of industry use cases. It offers a unique approach to consensus that enables performance at scale while preserving privacy.
https://wiki.hyperledger.org/display/fabric
Apache License 2.0
15.74k stars 8.85k forks source link

ClientHandshake -> Client TLS handshake failed after 10.52275ms with error: tls: first record does not look like a TLS handshake remoteaddress=127.0.0.1:7051 #3241

Open elyssa12 opened 2 years ago

elyssa12 commented 2 years ago

when I try " peer channel join -b $BLOCKFILE" , this error comes. How to resolve it ? Is it a source error? Following config:

---
Organizations:
  - &OrdererOrg
    Name: OrdererOrg
    ID: OrdererMSP
    MSPDir: crypto-config/ordererOrganizations/trace.com/msp
    Policies:
      Readers:
        Type: Signature
        Rule: "OR('OrdererMSP.member')"
      Writers:
        Type: Signature
        Rule: "OR('OrdererMSP.member')"
      Admins:
        Type: Signature
        Rule: "OR('OrdererMSP.admin')"

    OrdererEndpoints:
      - ordererOrg1.trace.com:7050
      - ordererOrg2.trace.com:7060
      - ordererOrg3.trace.com:7070

  - &Org1
    Name: Org1MSP
    ID: Org1MSP
    MSPDir: crypto-config/peerOrganizations/org1.trace.com/msp
    Policies:
      Readers:
        Type: Signature
        Rule: "OR('Org1MSP.admin', 'Org1MSP.peer', 'Org1MSP.client')"
      Writers:
        Type: Signature
        Rule: "OR('Org1MSP.admin', 'Org1MSP.client')"
      Admins:
        Type: Signature
        Rule: "OR('Org1MSP.admin')"
      Endorsement:
        Type: Signature
        Rule: "OR('Org1MSP.peer')"
    # AnchorPeers:
    #   - Host: peer0.org1.trace.com
    #     Port: 7051

  - &Org2
    Name: Org2MSP
    ID: Org2MSP
    MSPDir: crypto-config/peerOrganizations/org2.trace.com/msp
    Policies:
      Readers:
        Type: Signature
        Rule: "OR('Org2MSP.admin', 'Org2MSP.peer', 'Org2MSP.client')"
      Writers:
        Type: Signature
        Rule: "OR('Org2MSP.admin', 'Org2MSP.client')"
      Admins:
        Type: Signature
        Rule: "OR('Org2MSP.admin')"
      Endorsement:
        Type: Signature
        Rule: "OR('Org2MSP.peer')"
    # AnchorPeers:
    #   - Host: peer0.org2.trace.com
    #     Port: 8051

  - &Org3
    Name: Org3MSP
    ID: Org3MSP
    MSPDir: crypto-config/peerOrganizations/org3.trace.com/msp
    Policies:
      Readers:
        Type: Signature
        Rule: "OR('Org3MSP.admin', 'Org3MSP.peer', 'Org3MSP.client')"
      Writers:
        Type: Signature
        Rule: "OR('Org3MSP.admin', 'Org3MSP.client')"
      Admins:
        Type: Signature
        Rule: "OR('Org3MSP.admin')"
      Endorsement:
        Type: Signature
        Rule: "OR('Org3MSP.peer')"
    # AnchorPeers:
    #   - Host: peer0.org3.trace.com
    #     Port: 9051

Capabilities:
  Channel: &ChannelCapabilities
    V2_0: true
  Orderer: &OrdererCapabilities
    V2_0: true
  Application: &ApplicationCapabilities
    V2_0: true

Application: &ApplicationDefaults

  Organizations:

  Policies:
    Readers:
      Type: ImplicitMeta
      Rule: "ANY Readers"
    Writers:
      Type: ImplicitMeta
      Rule: "ANY Writers"
    Admins:
      Type: ImplicitMeta
      Rule: "MAJORITY Admins"
    LifecycleEndorsement:
      Type: ImplicitMeta
      Rule: "MAJORITY Endorsement"
    Endorsement:
      Type: ImplicitMeta
      Rule: "MAJORITY Endorsement"

  Capabilities:
    <<: *ApplicationCapabilities

Orderer: &OrdererDefaults

  OrdererType: etcdraft

  Addresses: # orderer
    - ordererOrg1.trace.com:7050
    - ordererOrg2.trace.com:7060
    - ordererOrg3.trace.com:7070

  EtcdRaft:
    Consenters:
      - Host: ordererOrg1.trace.com
        Port: 7050
        ClientTLSCert: crypto-config/ordererOrganizations/trace.com/orderers/ordererOrg1.trace.com/tls/server.crt
        ServerTLSCert: crypto-config/ordererOrganizations/trace.com/orderers/ordererOrg1.trace.com/tls/server.crt
      - Host: ordererOrg2.trace.com
        Port: 7060
        ClientTLSCert: crypto-config/ordererOrganizations/trace.com/orderers/ordererOrg2.trace.com/tls/server.crt
        ServerTLSCert: crypto-config/ordererOrganizations/trace.com/orderers/ordererOrg2.trace.com/tls/server.crt
      - Host: ordererOrg3.trace.com
        Port: 7070
        ClientTLSCert: crypto-config/ordererOrganizations/trace.com/orderers/ordererOrg3.trace.com/tls/server.crt
        ServerTLSCert: crypto-config/ordererOrganizations/trace.com/orderers/ordererOrg3.trace.com/tls/server.crt
  BatchTimeout: 2s

  BatchSize:

    MaxMessageCount: 1000

    AbsoluteMaxBytes: 256 MB

    PreferredMaxBytes: 512 KB

  Organizations:

  Policies:
    Readers:
      Type: ImplicitMeta
      Rule: "ANY Readers"
    Writers:
      Type: ImplicitMeta
      Rule: "ANY Writers"
    Admins:
      Type: ImplicitMeta
      Rule: "MAJORITY Admins"
    BlockValidation:
      Type: ImplicitMeta
      Rule: "ANY Writers"

Channel: &ChannelDefaults

  Policies:
    # Who may invoke the 'Deliver' API
    Readers:
      Type: ImplicitMeta
      Rule: "ANY Readers"
    # Who may invoke the 'Broadcast' API
    Writers:
      Type: ImplicitMeta
      Rule: "ANY Writers"
    # By default, who may modify elements at this config level
    Admins:
      Type: ImplicitMeta
      Rule: "MAJORITY Admins"

  Capabilities:
    <<: *ChannelCapabilities

Profiles:
  SupplyChannelGenesis: 
    <<: *ChannelDefaults
    Orderer:
      <<: *OrdererDefaults
      Organizations:
        - *OrdererOrg
      Capabilities: *OrdererCapabilities
    Application:
      <<: *ApplicationDefaults
      Organizations:
        - *Org1
        - *Org2
      Capabilities: *ApplicationCapabilities

couch.yaml

version: '3.7'

networks:
  mdtnet:
    name: Fabric_net

services:
  couchdb0:
    container_name: couchdb0
    image: couchdb:3.1.1
    labels:
      service: hyperledger-fabric
    environment:
      - COUCHDB_USER=admin
      - COUCHDB_PASSWORD=adminpw
    ports:
      - "5984:5984"
    networks:
      - mdtnet

  peer0.org1.trace.com:
    environment:
      - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
      - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb0:5984
      - CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=admin
      - CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=adminpw
    depends_on:
      - couchdb0
image image image
luca-simonetti commented 2 years ago

same error

elyssa12 commented 2 years ago

已收到,谢谢。

查阅后,将尽快给您回复。

AkshitV commented 1 year ago

were u able to solve this ?

elyssa12 commented 1 year ago

已收到,谢谢。

查阅后,将尽快给您回复。

paullam328 commented 7 months ago

Bump

elyssa12 commented 7 months ago

已收到,谢谢。

查阅后,将尽快给您回复。