使用Fabric Node SDK调用事务时不接受请求超时设置

时间:2018-09-17 02:26:45

标签: hyperledger-fabric

我在request-timeout中将sendProposal参数和Peer对象设置设置为240000(4分钟),如下所示:

targets: 
   [ Peer {
       _options: 
        { 'request-timeout': 240000,
          'grpc.max_receive_message_length': -1,
          'grpc.max_send_message_length': -1,
          'grpc.primary_user_agent': 'grpc-node/1.10.1 grpc-node/1.10.1' },
       clientCert: undefined,
       _url: 'grpc://localhost:7051',
       _endpoint: Endpoint { addr: 'localhost:7051', creds: ChannelCredentials {} },
       _name: 'localhost:7051',
       _request_timeout: 240000,
       _grpc_wait_for_ready_timeout: 3000,
       _endorserClient: ServiceClient { '$channel': Channel {} },
       _discoveryClient: ServiceClient { '$channel': Channel {} } },
     Peer {
       _options: 
        { 'request-timeout': 240000,
          'grpc.max_receive_message_length': -1,
          'grpc.max_send_message_length': -1,
          'grpc.primary_user_agent': 'grpc-node/1.10.1 grpc-node/1.10.1' },
       clientCert: undefined,
       _url: 'grpc://localhost:8051',
       _endpoint: Endpoint { addr: 'localhost:8051', creds: ChannelCredentials {} },
       _name: 'localhost:8051',
       _request_timeout: 240000,
       _grpc_wait_for_ready_timeout: 3000,
       _endorserClient: ServiceClient { '$channel': Channel {} },
       _discoveryClient: ServiceClient { '$channel': Channel {} } },
     Peer {
       _options: 
        { 'request-timeout': 240000,
          'grpc.max_receive_message_length': -1,
          'grpc.max_send_message_length': -1,
          'grpc.primary_user_agent': 'grpc-node/1.10.1 grpc-node/1.10.1' },
       clientCert: undefined,
       _url: 'grpc://localhost:9051',
       _endpoint: Endpoint { addr: 'localhost:9051', creds: ChannelCredentials {} },
       _name: 'localhost:9051',
       _request_timeout: 240000,
       _grpc_wait_for_ready_timeout: 3000,
       _endorserClient: ServiceClient { '$channel': Channel {} },
       _discoveryClient: ServiceClient { '$channel': Channel {} } } ],
  chaincodeId: 'chaincode2',
  fcn: 'invoke_other_chaincode',
  args: [ 'a', 'b', '10', 'chaincode1', 'public-channel' ],
  chainId: 'public-channel',
  txId: 
   TransactionID {
     _nonce: <Buffer d4 c3 50 45 ed c0 51 90 b3 9a c2 2b 3b d3 4a 9c e0 d5 23 19 22 90 19 e2>,
     _transaction_id: 'ff4db5af733660db9d4eaf9e143ff0688b5169912c6e9b0fa90e4358628123db',
     _admin: false } }

但是,我在60秒以上收到请求超时错误,远远低于阈值(4分钟)

error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: failed to execute transaction ff4db5af733660db9d4eaf9e143ff0688b5169912c6e9b0fa90e4358628123db: error sending: timeout expired while executing transaction
    at /Users/aldred/Workspace/blockchain/bezant-blockchain-api/node_modules/fabric-client/lib/Peer.js:118:16
    at /Users/aldred/Workspace/blockchain/bezant-blockchain-api/node_modules/grpc/src/client.js:586:7
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: failed to execute transaction ff4db5af733660db9d4eaf9e143ff0688b5169912c6e9b0fa90e4358628123db: error sending: timeout expired while executing transaction
    at /Users/aldred/Workspace/blockchain/bezant-blockchain-api/node_modules/fabric-client/lib/Peer.js:118:16
    at /Users/aldred/Workspace/blockchain/bezant-blockchain-api/node_modules/grpc/src/client.js:586:7

请参阅下面的屏幕截图。如图所示,时间仅约60秒。更改后还有其他参数吗? enter image description here

0 个答案:

没有答案