0

Im trying to monitor my blockchain with hyperledger caliper. I created my own benchmark file by using one from the templates given in the repo. but I am getting this error

Error: Network configuration file "F:Blockchain\hyperledger-caliper\networks\fabric\docker-compose\3org1peercouchdb\docker-compose.yaml" is missing its "caliper.blockchain" string attribute
at Function.assertConfigurationFilePaths (F:\SE\3rd_Year\FYP\Blockchain\hyperledger-caliper\node_modules\@hyperledger\caliper-core\lib\common\utils\caliper-utils.js:75:19)

any ideas how to fix this?

lp_nave
  • 244
  • 3
  • 17

1 Answers1

1

Problem

The problem is with the network configuration file that you are giving to Caliper. According to the official documentation of Hyperledger Caliper, the networking configuration consists of an YAML network configuration file. This file needs to have an object caliper, since it's Required and an Non-empty object, with an attribute blockchain within, that is Required and Non-empty string. Your log says that this object, and specific the attribute, are missing in the file you are specifying.

SOLUTION

The file you specify is a docker-composer file. The network configuration file for your Fabric blockhain should be similar to, for example, the one at 'networks/fabric/v1/v1.4.1/2org1peercouchdb/fabric-go.yaml' that contains the network configuration parameters required by the Hyperledger Caliper and that manages the docker containers at the attribute commmand within the caliper object.

You can get those files at caliper github repository and also check the Hyperledger Caliper official documentation for a better understanding.

Example

You should have a network configuration file that specifies the blockhain that you are using, on the attribute caliper.blockchain, and how are the docker containers managed, on the attribute caliper.command (just like the remaining and required parameters). For example:

...
caliper:
  blockchain: fabric
  command:
    start: export FABRIC_VERSION=1.4.0;export FABRIC_CA_VERSION=1.4.0;docker-compose -f networks/fabric/docker-compose/2org1peercouchdb/docker-compose.yaml up -d;sleep 3s
    end: docker-compose -f networks/fabric/docker-compose/2org1peercouchdb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q);rm -rf /tmp/hfc-*
  ...
...

Notes

I'm using JSON files as network configuration files to Hyperledger Sawtooth and Ethereum, with Hyperledger Caliper. However, I'm not sure if a JSON file works on Fabric benchmarking.