This guide outlines the steps to configure a benchmarking environment using Hardhat and Hyperledger Caliper, based on the bBench project.
- One contract per file
- The contract name must match the name of the contract defined in the Solidity code
This component simulates a local Ethereum network where the benchmark will be executed.
-
Download the Hardhat folder from the
bBenchrepository./hardhat
This component runs the tests and generates performance metrics based on the smart contracts.
-
Download the Caliper folder from the
bBenchrepository./caliper
Copy the contract(s) to be tested into:
/hardhat/contractsCompile the contracts with Hardhat to generate ABI files:
cd hardhat
. compile.sh contract_file.sol-
Edit the function parameters file:
/caliper/workloadGen/functionParameters.json
-
Run the scenario creation script:
Usage: createParam.sh MaxRound NumberOfWorkers RampUp(min) MeasurementTime(min) RampDown(min) NumberOfTps
cd /caliper/ethereum
. createScenario.sh 10 5 2 10 2 200With everything set up, run the benchmark tests:
- Run the bBench!!
Usage: startC.sh ContractName
cd /caliper/ethereum
. startC.sh contract_file/caliper/ethereum/outputRun DDL.sql Create the tables using this file.
Run EDA.sql to visualize and analyze the results.
- Make sure all file paths are correct and required configuration files are present.