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.json
config 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.yaml
file 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)