我使用超级分类器卡尺对我的本地fabric网络进行基准测试,但是我有一些错误,导致报告中缺少一些值,比如成功的交易和延迟。谁能帮我解决这些错误?详情如下:
toor@toor-VirtualBox:~/caliper-workspace$ **npx caliper launch manager --caliper-workspace ./ --caliper-networkconfig networks/networkConfig.yaml --caliper-benchconfig benchmarks/myAssetBenchmark.yaml --caliper-flow-only-test --caliper-fabric-gateway-enabled**
2022-04-20T07:42:51.316Z - error: [RoundRobinQueryHandler]: evaluate: message=Query failed. Errors: [], stack=FabricError: Query failed. Errors: []
at RoundRobinQueryHandler.evaluate (/home/toor/caliper-workspace/node_modules/fabric-network/lib/impl/query/roundrobinqueryhandler.js:66:23)
at Transaction.evaluate (/home/toor/caliper-workspace/node_modules/fabric-network/lib/transaction.js:319:49)
2022.04.20-10:42:51.318 error [caliper] [connectors/v2/FabricGateway] Failed to perform query transaction [ReadAsset] using arguments [0_8], with error: FabricError: Query failed. Errors: []
at RoundRobinQueryHandler.evaluate (/home/toor/caliper-workspace/node_modules/fabric-network/lib/impl/query/roundrobinqueryhandler.js:66:23)
2022-04-20T07:42:57.401Z - error: [Transaction]: Error: No valid responses from any peers. Errors:
at newEndorsementError (/home/toor/caliper-workspace/node_modules/fabric-network/lib/transaction.js:74:12)
at getResponsePayload (/home/toor/caliper-workspace/node_modules/fabric-network/lib/transaction.js:41:23)
at Transaction.submit (/home/toor/caliper-workspace/node_modules/fabric-network/lib/transaction.js:255:28)
at async V2FabricGateway._submitOrEvaluateTransaction (/home/toor/caliper-workspace/node_modules/@hyperledger/caliper-fabric/lib/connector-versions/v2/FabricGateway.js:376:26)
2022.04.20-10:42:57.509 error [caliper] [connectors/v2/FabricGateway] Failed to perform submit transaction [DeleteAsset] using arguments [1_2], with error: Error: No valid responses from any peers.
2022.04.20-10:42:57.759 info [caliper] [connectors/v2/FabricGateway] disconnecting gateway for user User1
2022.04.20-10:42:57.764 info [caliper] [worker-message-handler] Worker#1 finished Round#0
2022.04.20-10:43:02.773 info [caliper] [default-observer] Resetting txCount indicator count
2022.04.20-10:43:02.777 info [caliper] [report-builder] ### Test result ###
2022.04.20-10:43:02.835 info [caliper] [report-builder]
+-----------+------+------+-----------------+-----------------+------------------+-----------------+------------------+
| Name | Succ | Fail | Send Rate (TPS) | Max Latency (s) | Min Latency (s) | Avg Latency (s) | Throughput (TPS) |
|-----------|------|------|-----------------|-----------------|------------------|-----------------|------------------|
| readAsset | 0 | 1693 | 57.2 | 0.00 | 9007199254740.99 | - | 57.2 |
+-----------+------+------+-----------------+-----------------+------------------+-----------------+------------------+
2022.04.20-10:43:02.842 info [caliper] [round-orchestrator] Finished round 1 (readAsset) in 30.138 seconds
2022.04.20-10:43:02.844 info [caliper] [monitor.js] Stopping all monitors
2022.04.20-10:43:02.855 info [caliper] [report-builder] ### All test results ###
2022.04.20-10:43:02.869 info [caliper] [report-builder]
+-----------+------+------+-----------------+-----------------+------------------+-----------------+------------------+
| Name | Succ | Fail | Send Rate (TPS) | Max Latency (s) | Min Latency (s) | Avg Latency (s) | Throughput (TPS) |
|-----------|------|------|-----------------|-----------------|------------------|-----------------|------------------|
| readAsset | 0 | 1693 | 57.2 | 0.00 | 9007199254740.99 | - | 57.2 |
+-----------+------+------+-----------------+-----------------+------------------+-----------------+------------------+
2022.04.20-10:43:02.987 info [caliper] [report-builder] Generated report with path /home/toor/caliper-workspace/report.html
2022.04.20-10:43:02.988 info [caliper] [monitor.js] Stopping all monitors
2022.04.20-10:43:02.990 info [caliper] [worker-orchestrator] Sending exit message to connected workers
2022.04.20-10:43:02.991 info [caliper] [worker-message-handler] Worker#0 is exiting
2022.04.20-10:43:02.994 info [caliper] [worker-message-handler] Worker#1 is exiting
2022.04.20-10:43:02.995 info [caliper] [round-orchestrator] Benchmark finished in 42.057 seconds. Total rounds: 1. Successful rounds: 1. Failed rounds: 0.
2022.04.20-10:43:02.996 info [caliper] [caliper-engine] Skipping end command due to benchmark flow conditioning
2022.04.20-10:43:02.997 info [caliper] [cli-launch-manager] Benchmark successfully finished我的网络信任文件是: networkConfig.yaml
name: Calier test
version: "2.0.0"
caliper:
blockchain: fabric
sutOptions:
mutualTls: false
channels:
- channelName: mychannel
contracts:
- id: basic
organizations:
- mspid: Org1MSP
identities:
certificates:
- name: 'User1'
clientPrivateKey:
path: '/home/toor/EHRUsingBlockchain-master/fabric-scripts/hlfv12/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457_sk'
clientSignedCert:
path: '/home/toor/EHRUsingBlockchain-master/fabric-scripts/hlfv12/composer/crypto-config/peerOrganizations/org1.example.com/msp/cacerts/ca.org1.example.com-cert.pem'
connectionProfile:
path: '/home/toor/EHRUsingBlockchain-master/DevServer_connection.json'
discover: false
和基准测试文件: myAssetBenchmark.yaml
test:
name: basic-contract-benchmark
description: test benchmark
workers:
type: local
number: 2
rounds:
- label: readAsset
description: Read asset benchmark
txDuration: 30
rateControl:
type: fixed-load
opts:
transactionLoad: 2
workload:
module: workload/readAsset.js
arguments:
assets: 10
contractId: basic
和我的工作负载文件: readAsset.js
'use strict';
const { WorkloadModuleBase } = require('@hyperledger/caliper-core');
class MyWorkload extends WorkloadModuleBase {
constructor() {
super();
}
async initializeWorkloadModule(workerIndex, totalWorkers, roundIndex, roundArguments, sutAdapter, sutContext) {
await super.initializeWorkloadModule(workerIndex, totalWorkers, roundIndex, roundArguments, sutAdapter, sutContext);
for (let i=0; i<this.roundArguments.assets; i++) {
const assetID = `${this.workerIndex}_${i}`;
console.log(`Worker ${this.workerIndex}: Creating asset ${assetID}`);
const request = {
contractId: this.roundArguments.contractId,
contractFunction: 'CreateAsset',
invokerIdentity: 'User1',
contractArguments: [assetID,'blue','20','penguin','500'],
readOnly: false
};
await this.sutAdapter.sendRequests(request);
}
}
async submitTransaction() {
const randomId = Math.floor(Math.random()*this.roundArguments.assets);
const myArgs = {
contractId: this.roundArguments.contractId,
contractFunction: 'ReadAsset',
invokerIdentity: 'User1',
contractArguments: [`${this.workerIndex}_${randomId}`],
readOnly: true
};
await this.sutAdapter.sendRequests(myArgs);
}
async cleanupWorkloadModule() {
for (let i=0; i<this.roundArguments.assets; i++) {
const assetID = `${this.workerIndex}_${i}`;
console.log(`Worker ${this.workerIndex}: Deleting asset ${assetID}`);
const request = {
contractId: this.roundArguments.contractId,
contractFunction: 'DeleteAsset',
invokerIdentity: 'User1',
contractArguments: [assetID],
readOnly: false
};
await this.sutAdapter.sendRequests(request);
}
}
}
function createWorkloadModule() {
发布于 2022-04-20 09:16:34
在我看来,您已经安装了超级分类账结构1.2网络,并部署了超级分类账编写器业务网络。超级分类账作曲家现在已经寿终正寝(超级分类账织物1.x也是如此)。卡利珀也不再支持对超级分类账作曲家网络进行基准测试。
您尝试的方法似乎来自本教程,该教程使用了超级分类账结构2.2和已部署的资产转移链代码-basic。
卡尺工作负载模块必须了解实现的链码,因此工作负载模块被绑定到它们所测试的链码中。因此,您不能只使用教程中的卡尺组件,并尝试在部署了任何链码的任何超级分类系统结构网络上运行它,这是行不通的。Hyperledger Composer是一个特例,因为它有专门的链码,需要一个专门的客户端组件才能进行交互,这意味着卡钳需要专家作曲家的支持才能工作(也就是说,卡钳的fabric组件不能与部署在超级分类账织物上的超级分类账作曲家业务网络对话)。
支持hyperledger的卡钳的最后一个版本看起来是0.2.0,但是文档的外观是最小的,所以我认为如果您仍然想要追求标杆和生命结束环境,那么您就会成为自己的一部分。
https://stackoverflow.com/questions/71936538
复制相似问题