Настройка тайм-аута запроса не учитывается при вызове транзакции с использованием Fabric Node SDK - PullRequest
0 голосов
/ 17 сентября 2018

Я установил параметр 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

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...