Submitting transactions to AWS managed Hyperledger Fabric network from NodeJS client SDK

0

I have setup a managed Hyperledger Fabric network by following the documentation. I can invoke/query using peer commands. But transactions are failing when submitted through Hyperledger NodeJS client SDK. I'm getting below error from Node SDK.

 error: [ServiceEndpoint]: ServiceEndpoint grpcs://<REDACTED>.managedblockchain.us-east-1.amazonaws.com:30009 reset connection failed :: Error: Failed to connect before the deadline on Discoverer- name: <REDACTED>.managedblockchain.us-east-1.amazonaws.com:30009, url:grpcs:/<REDACTED>.managedblockchain.us-east-1.amazonaws.com:30009, connected:false, connectAttempted:true

I can see the below peer logs on Cloudwatch.

[core.comm] ServerHandshake -> ERRO bcac Server TLS handshake failed in 6.361384ms with error EOF server=PeerServer remoteaddress=10.0.1.135:55358

Seems like some TLS issue is causing this. The transaction was submitted using the credentials of a user enrolled using the CA endpoint. I have also tried to submit transaction using the admin's credentials (The docker cli container is using this identity and query/invoke peer commands are working inside cli), but the same error is coming. Are there any samples/guides available on connecting to the blockchain network using the SDKs?

asked a year ago779 views
1 Answer
0

Based on the error messages you provided, you may have a misconfigured connection profile that is causing these errors. Since you are able to invoke/query from the CLI, but not programmatically, please check the following:

  1. ensure you have the correct signing key / public cert in place when creating a wallet in the SDK.
  2. ensure you have added the root TLS cert chain to the common connection profile.
  3. ensure you have defined the endpoint(s) correctly in the connection profile.

To find examples of these, I would encourage you to check the “Invoking chaincode via API” portion of the workshop I have linked below. I would also encourage you to check that you have set up your Fabric client and client instance by going over the “Set up a Fabric Client” and the “Configure client instance” sections of the same workshop below.

https://catalog.us-east-1.prod.workshops.aws/workshops/008da2cb-8454-42d0-877b-bc290bff7fcf/en-US

To check you have configured your channel correctly view either one of these links from below:

https://catalog.us-east-1.prod.workshops.aws/workshops/008da2cb-8454-42d0-877b-bc290bff7fcf/en-US/03-chaincode/06-configure-channel

https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/get-started-create-channel.html

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions