Saved in:
Bibliographic Details
Main Authors: Vidal, Fernando Richter, Laranjeiro, Nuno, Ivaki, Naghmeh
Format: Recurso digital
Language:
Published: Zenodo 2025
Online Access:https://doi.org/10.5281/zenodo.15379338
Tags: Add Tag
No Tags, Be the first to tag this record!
Table of Contents:
  • <div><br> <h1>  <strong>bBench Setup & Benchmark Execution</strong></h1> <br> <div>This guide outlines the steps to configure a benchmarking environment using <strong>Hardhat</strong> and <strong>Hyperledger Caliper</strong>, based on the <strong>bBench </strong>project.</div> <br> <div>---</div> <br> <h1>✅ Requirements</h1> <ul> <li>One <strong>contract per file</strong></li> <li>The <strong>contract name</strong> must match the name of the contract defined in the Solidity code.</li> </ul> <div>---</div> </div> <div> </div> <h1>⚙️ Installation and Component Structure</h1> <div> </div> <div> <h2> Hardhat Component</h2> </div> <p> </p> <div>This component simulates a local Ethereum network where the benchmark will be executed.</div> <div> </div> <div>1. Download the Hardhat folder from the `bBench` repository.</div> <div> </div> <div>```bash</div> <div>/hardhat</div> <div>```</div> <div>---</div> <p> </p> <h2> Caliper Component</h2> <div> </div> <div>This component runs the tests and generates performance metrics based on the smart contracts.</div> <div> </div> <div>1. Download the Caliper folder from the `bBench` repository.</div> <div> </div> <div>```bash</div> <div>/caliper</div> <div>```</div> <div>---</div> <p> </p> <h2> Step 1 — Prepare the Input Folder</h2> <div> </div> <div>Copy the contract(s) to be tested into:</div> <div> </div> <div>```bash</div> <div>/hardhat/contracts</div> <div>```</div> <div>---</div> <p> </p> <h2>⚙️ Step 2 — Generate ABI Code</h2> <div> </div> <div>Compile the contracts with Hardhat to generate ABI files:</div> <div> </div> <div>```bash</div> <div>cd hardhat</div> <div>. compile.sh contract_file.sol</div> <div>```</div> <div>---</div> <p> </p> <h2> Step 3 — Set Up the Scenario</h2> <div>1. Edit the function parameters file:</div> <div> </div> <div>```bash</div> <div>/caliper/workloadGen/functionParameters.json</div> <div>```</div> <p> </p> <div>2. Run the scenario creation script:</div> <div> </div> <div>Usage: createParam.sh MaxRound NumberOfWorkers RampUp(min) MeasurementTime(min) RampDown(min) NumberOfTps</div> <div> </div> <div>```bash</div> <div>cd /caliper/ethereum</div> <div>. createScenario.sh 10 5 2 10 2 200</div> <div>```</div> <div>---</div> <div> </div> <div> </div> <h2> Step 4 — Run the Benchmark</h2> <div> </div> <div>With everything set up, run the benchmark tests:</div> <div> </div> <div>1. Run the bBench!!</div> <div> </div> <div>Usage: startC.sh ContractName</div> <p> </p> <div>```bash</div> <div>cd /caliper/ethereum</div> <div>. startC.sh contract_file</div> <div>```</div> <div>---</div> <p> </p> <h2> Step 5 — Analyze the All Merged Output Files</h2> <p> </p> <div>```bash</div> <div>/caliper/ethereum/output</div> <div>```</div> <div>---</div> <p> </p> <h2>(Optional) Step 6 — Insert the CSV Files into the PostgreSQL Database</h2> <p> </p> <div>1. Run `DDL.sql` Create the tables using this file.</div> <div>2. Run `EDA.sql` to visualize and analyze the results.</div> <div>---</div> <div> </div> <h2> Final Notes</h2> <p> </p> <div>- Make sure all file paths are correct and required configuration files are present.</div> <p> </p> <div>---</div>