dev
dev

Reputation: 61

Failed to get network: Failed to create new channel client: event service creation failed: could not get chConfig cache reference

Failed to get network: Failed to create new channel client: event service creation failed: could not get chConfig cache reference: QueryBlockConfig failed: QueryBlockConfig failed: queryChaincode failed: Transaction processing for endorser [peer-node-endpoint]: Endorser Client Status Code: (2) CONNECTION_FAILED. Description: dialing connection on target [peer-node-endpoint]: connection is in TRANSIENT_FAILURE

Getting this error when trying to connect fabric-sdk-go with network using connection-profile.yaml in Hyperledger fabric.

NOTE: chaincode is deployed and works just fine when I hit transaction from terminal.So no doubts on this side.

I saw same problem is posted on stack-overflow already but thats outdated as hyperledger-fabric v2.2 changes a lot as compared to v1.

Here is my connection profile from fabric-samples test-network.(only difference is I gave path of tls-cert file instead of pasting private key.

Here is connection-profile.yaml of test-network which works fine on local machine.

---
name: test-network-org1
version: 1.0.0
client:
  organization: Org1
  connection:
    timeout:
      peer:
        endorser: '300'
organizations:
  Org1:
    mspid: Org1MSP
    peers:
    - peer0.org1.example.com
    certificateAuthorities:
    - ca.org1.example.com
peers:
  peer0.org1.example.com:
    url: grpcs://localhost:7051
    tlsCACerts:
      path: /path/to/cert/file

    grpcOptions:
      ssl-target-name-override: peer0.org1.example.com
      hostnameOverride: peer0.org1.example.com
certificateAuthorities:
  ca.org1.example.com:
    url: https://localhost:7054
    caName: ca-org1
    tlsCACerts:
      path: /path/to/cert/file
          
    httpOptions:
      verify: false

But if just change peer (logical) name i.e peer0.org1.example.com. from

So i am just wondering why is it the case because in hyperledger-fabric connection-profile documentation it say that this name is just logical name and nothing else and we can give it any name and all that matters is (peer/ca) url endpoint. hyperledger peer naming docs reference

And new connection-profile looks like this:

---
name: test-network-org1
version: 1.0.0
client:
  organization: Org1
  connection:
    timeout:
      peer:
        endorser: '300'
organizations:
  Org1:
    mspid: Org1MSP
    peers:
    - peer0.org1.com
    certificateAuthorities:
    - ca.org1.example.com
peers:
  peer0.org1.com:
    url: grpcs://localhost:7051
    tlsCACerts:
      path: /path/to/cert/file

    grpcOptions:
      ssl-target-name-override: peer0.org1.com
      hostnameOverride: peer0.org1.com
certificateAuthorities:
  ca.org1.example.com:
    url: https://localhost:7054
    caName: ca-org1
    tlsCACerts:
      path: /path/to/cert/file
          
    httpOptions:
      verify: false

And in docker logs it shows this error:

peer0.org1.example.com|2022-10-03 06:47:51.442 UTC 0c95 ERRO [core.comm] ServerHandshake -> Server TLS handshake failed in 3.5334ms with error remote error: tls: bad certificate server=PeerServer remoteaddress=172.20.0.1:61090

Now the path to cert file is correct and thats I'm sure about.

So can anyone guide me why changing just peer (logical) name on local hit this error.

if someone want to create same case.This can also be produced on Local (by running test-network from fabric-samples).

And as far code is concerned its the same as in fabric-samples I am just trying to run it using connection-profile.yaml (assetTransdferBasic case).

if anyone want any help regarding more detail I will be available.

Upvotes: 4

Views: 420

Answers (0)

Related Questions