2

I have cloned the fabric samples repository and am running the byfn script to build the first network. I am using the node js SDK for application development. I have written a chain code function which does a time-consuming computation and the returns a true/false value to the middleware.

I have installed my chain-code in only peer0 from Org1.

Unfortunately, I get a timeout there is no response from the chaincode for ~30seconds. The error I get is shown below:

warn: [Query]: evaluate: Query ID "[object Object]" of peer "peer0.org1.example.com:7051" failed: message=failed to execute transaction 799eb959954a7f2f8f75dee735969a4ba374b4bc98b4bbacd2fc85fc57a860b9: error sending: timeout expired while executing transaction, stack=Error: failed to execute transaction 799eb959954a7f2f8f75dee735969a4ba374b4bc98b4bbacd2fc85fc57a860b9: error sending: timeout expired while executing transaction
    at self._endorserClient.processProposal (/home/jacktheripper/fabric-samples/zeroknowledge/snarkjs/node_modules/fabric-client/lib/Peer.js:140:36)
    at Object.onReceiveStatus (/home/jacktheripper/fabric-samples/zeroknowledge/snarkjs/node_modules/grpc/src/client_interceptors.js:1207:9)
    at InterceptingListener._callNext (/home/jacktheripper/fabric-samples/zeroknowledge/snarkjs/node_modules/grpc/src/client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (/home/jacktheripper/fabric-samples/zeroknowledge/snarkjs/node_modules/grpc/src/client_interceptors.js:618:8)
    at callback (/home/jacktheripper/fabric-samples/zeroknowledge/snarkjs/node_modules/grpc/src/client_interceptors.js:845:24), status=500, , url=grpcs://localhost:7051, name=peer0.org1.example.com:7051, grpc.max_receive_message_length=-1, grpc.max_send_message_length=-1, grpc.keepalive_time_ms=120000, grpc.http2.min_time_between_pings_ms=12000, grpc.keepalive_timeout_ms=2000000, grpc.http2.max_pings_without_data=5, grpc.keepalive_permit_without_calls=1, name=peer0.org1.example.com:7051, grpc.ssl_target_name_override=peer0.org1.example.com, grpc.default_authority=peer0.org1.example.com, isProposalResponse=true

Inorder to resolve this, I figured that I would have to overide the default timeout configurations in fabric. SO, I made changes to the deafault.jsonconfig file inside the fabric-client node module.I increased the values inside the keys of "request-timeout","grpc.keepalive_timeout_ms", "grpc-wait-for-ready-timeout" but my applicationstill times out in like ~30-35 seconds. I also changes the timeout parameter value in the connection-org1.yamlfile but the application still times out at the same time.

How do I increase this timeout time to allow the heavy computation inside my chaincode? I know that my chaincode and fabric installations are correct because because the same applciationa and chaincode runs finein a system with better resources(i.e the computation takes ~15 seconds in faster computer)

  • info you need is in this post https://stackoverflow.com/questions/51503153/best-practices-to-follow-while-writing-hyperledger-fabric-chaincode/51503154#51503154 – david_k Sep 13 '19 at 08:17
  • @david_k : I tried adding `CORE_CHAINCODE_EXECUTETIMEOUT` to a larger value, but that doesn't increase the timeout from 30 s. I made changes to the environment variable of peer1 (where the chaincode is installed) in docker-compose file of byfn folder – Akshay Mathew Sep 13 '19 at 12:10
  • You should change it on all peers epecially peer0 as that is the peer where you reported the error was. – david_k Sep 13 '19 at 12:52
  • Unfortunately, changing it on peer0 also didn't work @david_k – Akshay Mathew Sep 17 '19 at 08:00
  • It's the right value to change to increase it from the default 30 second timeout, so maybe the value you are supplying is incorrect assuming you have restarted everything by removing all existing containers. – david_k Sep 17 '19 at 08:01
  • @david_k, But I also don't see `CORE_CHAINCODE_EXECUTETIMEOUT` with a default value of `30` written anywhere in yaml files in byfn folder. I had to additionally write this inside the `env` variable for the peers. Shouldn't it be written by default somewhere? Or am I missing something here? – Akshay Mathew Sep 17 '19 at 10:04
  • It is defined in the core.yaml file used by the peer executable as is part of the peer image. – david_k Sep 17 '19 at 16:40
  • DId u got the solution @AkshayMathew – sachin murali Nov 21 '19 at 03:41
  • No, I couldn't find a work around @sachinmurali – Akshay Mathew Nov 29 '19 at 05:21
  • @AkshayMathew Is there any fix for this issue. Could you please update? – sai Jul 07 '20 at 06:03

0 Answers0