0
votes

I have created a sample HLF network with 3 organizations. I have taken an orderer and a peer from each organization ( total 3 orderers, 3 peers, 3 fabric-CA, 3 CouchDB instances).

I have successfully created the certificates, system channel, channel configuration, application channel and also successfully deployed the chaincode on each peer. I am able to invoke/query any chaincode using peer binary in docker cli but not able to invoke/query the same chaincode through fabric Node SDK.

I have created the connection profile as per the template provided in the test network and also able to register any user for a specific organization. But whenever I am trying to query any chaincode function I am getting the below error:

[ServiceEndpoint]: Error: Failed to connect before the deadline on Committer- name: orderer.example.com:7050, url:grpcs://localhost:7050, connected:false, connectAttempted:true [ServiceEndpoint]: waitForReady

  • Failed to connect to remote gRPC server orderer.example.com:7050 url:grpcs://localhost:7050 timeout:3000

When I check the orderer logs I found this error:

ServerHandshake -> ERRO 087 Server TLS handshake failed in 2.085859ms with error EOF server=Orderer remoteaddress=172.23.0.1:45678

**Why I am getting this error?

I am trying to just query so why it's connecting to the orderer?

If there is any TLS issue then why I am able to query it through peer binary?**

1

1 Answers

0
votes

This link might help Hyperledger Fabric CA releasing wrong certificates (wrong issuer) to Node SDK when TLS enabled

If you are not running as a test network on your local machine, then you will need to specify the connection option of discovery.asLocalhost as false