简体   繁体   English

Hyperledger Fabric/Hyperledger Caliper 基准测试

[英]Hyperledger Fabric/Hyperledger Caliper Benchmarking

Been learning a bit about both Hyperledger Fabric and Hyperledger Caliper recently.最近一直在学习一些关于 Hyperledger Fabric 和 Hyperledger Caliper 的知识。

Recently have been following the Hyperledger Caliper Fabric benchmarking tutorial here to learn a bit more about it.最近一直在关注 Hyperledger Caliper Fabric 基准测试教程以了解更多关于它的信息。

It uses the Fabric Samples network as an example with the sample chaincode used being the asset-transfer-basic javascript.它使用 Fabric Samples 网络作为示例,使用的示例链代码是资产转移基本 javascript。

When running caliper for creating 1000 assets for example.例如,在运行 caliper 以创建 1000 个资产时。

I get an occasional error initializing the test during the asset creation operation, like this:在资产创建操作期间初始化测试时偶尔会出现错误,如下所示:

    2021-05-05T21:28:58.344Z - error: [DiscoveryHandler]: compareProposalResponseResults[undefined] - read/writes result sets do not match index=1
2021-05-05T21:28:58.344Z - error: [Transaction]: Error: No valid responses from any peers. Errors:
    peer=undefined, status=grpc, message=Peer endorsements do not match
2021.05.05-22:28:58.344 error [caliper] [connectors/v2/FabricGateway]   Failed to perform submit transaction [CreateAsset] using arguments [0_231,blue,20,penguin,500],  with error: Error: No valid responses from any peers. Errors:
    peer=undefined, status=grpc, message=Peer endorsements do not match

The sample chaincode operation is pretty simple:示例链码操作非常简单:

// CreateAsset issues a new asset to the world state with given details.
    async CreateAsset(ctx, id, color, size, owner, appraisedValue) {
        const asset = {
            ID: id,
            Color: color,
            Size: size,
            Owner: owner,
            AppraisedValue: appraisedValue,
        };
        ctx.stub.putState(id, Buffer.from(JSON.stringify(asset)));
        return JSON.stringify(asset);
    }

Is there any particular reason errors like this happen?发生这种错误是否有任何特殊原因? Even if occasionally.即使偶尔。

The tutorial in caliper explicitly checks out a specific tag in the fabric-samples. caliper 中的教程明确检查了织物样本中的特定标签。 This is because there is a bug in the chaincode examples in the main branch which isn't present in the specific git commit.这是因为main分支中的链代码示例中有一个错误,该错误在特定的 git 提交中不存在。 That bug causes the problem you are seeing You have actually included that bug in the snippet you posted.该错误导致您看到的问题您实际上已将该错误包含在您发布的代码段中。 In the chaincode it's the line在链码中它是行

ctx.stub.putState(id, Buffer.from(JSON.stringify(asset)));

which is incorrect.这是不正确的。 It should be它应该是

await ctx.stub.putState(id, Buffer.from(JSON.stringify(asset)));

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Caliper对Hyperledger织物进行基准测试(如果更改了织物架构) - Benchmarking of Hyperledger fabric with Caliper (if fabric architecture is changed) 使用 Hyperledger Caliper 对不同机器中的 Hyperledger 织物进行基准测试 - Benchmarking with Hyperledger Caliper for Hyperledger fabric which are in different machine 使用筏式共识在多主机部署的Hyperledger Fabric v1.4.1网络上使用Hyperledger卡尺进行基准测试 - Benchmarking with Hyperledger caliper on multi host deployed Hyperledger fabric v1.4.1 network with raft consensus Hyperledger Caliper 不绑定在结构网络上 - Hyperledger Caliper doen´t bind on fabric network 使用基于kafka的订购功能使用Hyperledger Fabric 1.4设置Hyperledger Caliper - Setting up Hyperledger Caliper with Hyperledger Fabric 1.4 with kafka based ordering 如何在 Kubernetes 设置中使用 Hyperledger Caliper 测量 Hyperledger Fabric 性能 - How to measure Hyperledger Fabric performance using Hyperledger Caliper in Kubernetes setting 为什么我不能将 Caliper 的交易提交到 Hyperledger Fabric? - Why can't I commit transactions with Caliper to Hyperledger Fabric? 使用超级账本结构卡尺的资源监视器 - 错误:套接字挂起 - Resource monitor using hyperledger fabric caliper - Error: socket hang up Hyperledger Fabric Caliper 未使用证书颁发机构 (CA) 服务器提交交易 - Hyperledger Fabric Caliper is not using Certificate Authority (CA) server to submit transaction 使用 Fabric 2.1 运行 Hyperledger Caliper V0.4.2 时出现验证错误 - Validation Error in running Hyperledger Caliper V0.4.2 with Fabric 2.1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM