当我正在运行用于测量Fabric 2.1.0 1.4.7基准的Caliper V0.4.2时,我得到了以下错误
ValidationError: child "version" fails because ["version" must be one of [1.0]]. child "clients" fails because ["clients" is required]. child "channels" fails because ["channels" must be an object]. child "organizations" fails because ["organizations" must be an object]. child "orderers" fails because ["orderers" is required]. child "peers" fails because ["peers" is required]
at Object.exports.process (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/@hapi/joi/lib/errors.js:202:19)
at internals.Object._validateWithOptions (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/@hapi/joi/lib/types/any/index.js:763:31)
at module.exports.internals.Any.root.validate (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/@hapi/joi/lib/index.js:145:23)
at Function._validateTopLevel (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/@hyperledger/caliper-fabric/lib/configValidator.js:208:26)
at Function.validateNetwork (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/@hyperledger/caliper-fabric/lib/configValidator.js:58:25)
at new FabricConnector (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/@hyperledger/caliper-fabric/lib/fabric-connector.js:107:25)
at CaliperEngine.connectorFactory [as adapterFactory] (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/@hyperledger/caliper-fabric/lib/connectorFactory.js:26:23)
at CaliperEngine.run (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/@hyperledger/caliper-core/lib/manager/caliper-engine.js:93:36)
at Function.handler (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/@hyperledger/caliper-cli/lib/launch/lib/launchManager.js:62:43)
at Object.module.exports.handler (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/@hyperledger/caliper-cli/lib/launch/launchManagerCommand.js:46:44)
isJoi: true,
name: 'ValidationError',
details:
[ { message: '"version" must be one of [1.0]',
path: [Array],
type: 'any.allowOnly',
context: [Object] },
{ message: '"clients" is required',
path: [Array],
type: 'any.required',
context: [Object] },
{ message: '"channels" must be an object',
path: [Array],
type: 'object.base',
context: [Object] },
{ message: '"organizations" must be an object',
path: [Array],
type: 'object.base',
context: [Object] },
{ message: '"orderers" is required',
path: [Array],
type: 'any.required',
context: [Object] },
{ message: '"peers" is required',
path: [Array],
type: 'any.required',
context: [Object] } ],
_object:
{ name: 'Caliper Benchmarks',
version: '2.1.0',
caliper: { blockchain: 'fabric' },
channels: [ [Object] ],
organizations: [ [Object] ] },
annotate: [Function] }我执行的命令是,
npm init -y
npm安装
npx卡尺绑扎卡尺粘合织物:2.1
./network.sh deployCC -ccn simple -ccp -ccp -ccl javascript
npx卡尺启动管理器--卡尺-工作区./ -卡尺-networkconfig网络/fabric/test-network.yaml--卡尺-基准配置基准配置/场景/simple/config.yaml-杯流-只测试-口径-结构-网关启用
Hyperledger网络创建、信道创建和链码部署都是成功的。
如何解决这个错误?
发布于 2022-03-07 12:36:01
看来你在使用卡尺基准测试的主要分支。我建议你https://github.com/hyperledger/caliper-benchmarks/blob/main/networks/fabric/README.md
根据您已经发布的信息,您应该使用最新可用的卡尺版本,即0.4.2,而不是0.4.0。为此,您应该发出的命令是
npm install --only=prod @hyperledger/caliper-cli您应该绑定到最新的2.2SDK(不要绑定到2.1,因为fabric不支持2.1)。注意,这是选择用于与fabric网络交互的sdk版本,而不是您正在使用的fabric网络版本。2.2将适用于fabric 2.2及更高版本的2.x版本
npx caliper bind --caliper-bind-sut fabric:2.2最后,您似乎试图更改网络配置文件中的版本号。不要更改版本(必须为2.0.0),因为它指的是网络配置文件的版本,而不是要测试的fabric版本
当您正在使用测试网络时,取决于您使用的fabric示例的哪个分支定义了fabric的版本。主要的分支测试最新版本的织物,这应该没有问题。
https://stackoverflow.com/questions/71380035
复制相似问题