I am trying to send request to hyperledger fabric blockchain network through my NodeJS test client and I always receive the following:
error: [Remote.js]: Error: Failed to connect before the deadline
[hl] Query has completed, checking results
[hl] Query error: Error: Failed to connect before the deadline
at checkState (/opt/hl/test/frontend/node_modules/fabric-client/node_modules/grpc/src/client.js:838:16)
I am trying to find out what is wrong, there is nothing suspicious in peer logs. I am using the following version:
- HL v1.2.0
- NodeJS v8.11.4
- grpc v1.14.1
EDIT:
The code that is failing:
var channel = fabric_client.newChannel('mychannel');
var peer = fabric_client.newPeer('grpc://localhost:7051');
channel.addPeer(peer);
var order = fabric_client.newOrderer('grpc://localhost:7050')
channel.addOrderer(order);
channel.queryByChaincode(request) <-- ERROR
The hyperledger is running because I am able to query and invoke chaincode functions through Java SDK.