gpt4 book ai didi

node.js - 错误 : Failed to connect before the deadline when firing transactions at high rate

转载 作者:搜寻专家 更新时间:2023-11-01 00:03:39 25 4
gpt4 key购买 nike

我正在尝试对 Hyperledger Fabric v1.2 执行性能测试。使用 fabcar 链代码设置网络。交易到达率在 50 RPS。使用 Node JS 应用程序接受交易请求。交易执行 putState 操作,通过在分类帐中添加新变量,使用 this代码。

  • 使用的共识:Solo
  • Node 数:4(排序 Node 和所有 Node 都在不同的虚拟机)
  • 分类帐:CouchDB

在较低的 RPS (0-20) 下,所有交易都成功通过。将交易到达率提高到 50 后,大约 50% 的交易因错误而失败

Transaction proposal was good
Successfully sent Proposal and received ProposalResponse: Status - 200, message - ""
error: [Remote.js]: Error: Failed to connect before the deadline
error: [Orderer.js]: Orderer grpc://x.x.x.x:7050 has an error Error: Failed to connect before the deadline
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error:
Failed to connect before the deadline

这个错误究竟意味着什么?为什么客户端无法将已背书的交易发送给订购者?大约 20% 的人因以下错误而失败

Send transaction promise and event listener promise have completed in 30086 ms
Successfully sent transaction to the orderer.
Transaction failed to be committed to the ledger due to ::TIMEOUT

根据不同的研究论文,Hyperledger Fabric 必须能够以高达 2000 的速率处理请求,为什么会给出这样的结果?

最佳答案

我在使用 fabric-samples 存储库中的调用代码时遇到了同样的问题。我通过更改 promise 链的顺序解决了这个问题。

我的做法如下:

return checkUser(this.user)
.then(() => return channel.sendTransactionProposal(request))
.then((results) => checkPrposal(results))
.then((results) => submitTrasaction(results))
.then(() => connectEventHub())

关于node.js - 错误 : Failed to connect before the deadline when firing transactions at high rate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55744928/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com