ClinConNet Performance Testing Suite
This repository contains two distinct performance testing suites for the ClinConNet project.
Client-Side (Puppeteer): A suite for measuring the performance of the client-side cryptographic functions within the ClinConNet-Veramo-Wallet Chrome extension.
Blockchain (Hyperledger Caliper): A suite for measuring the transaction throughput and latency of the ConsentContract smart contract on a Hyperledger Fabric network.
📋 Prerequisites
Before running these tests, ensure you have the following installed and running:
Node.js (v18.x or later)
A running Hyperledger Fabric network with the consentcc chaincode instantiated.
The compiled ClinConNet Chrome Extension, from the ClinConNet-SSI-wallet project (dist) --> https://github.com/montassar-isbored/ClinConNet-SSI-wallet
The ClinConNet Portal project, which contains the chaincodes and connection profile --> https://github.com/montassar-isbored/ClinConNet-Portal
🚀 Part 1: Client-Side Performance Testing (Puppeteer) in SSI-workspace
This suite uses Puppeteer to programmatically control the Chrome extension and measure the performance of its core cryptographic functions.
- Configuration
Open the test.js file and ensure the following constants are set correctly:
EXTENSION_PATH: Must point to the absolute path of your compiled extension's dist folder.
NUM_RUNS & NUM_ITERATIONS: Can be adjusted to control the duration and sample size of the test.
- Execution
Run the test script from the root of this project using Node.js: Bash
node test.js
The script will launch a headless Chrome browser, run all the defined tests, and log the results to the console.
- Output
A file named performance_results.csv will be created. This file contains the detailed latency measurements for each function call across all runs and iterations, ready for statistical analysis. Use the python plot.py script to generate a figure from the .csv file, make sure the paths are correct. In /Perf-results/ssi-test-results we provide 3 test results.
⛓️ Part 2: Blockchain Performance Testing (Hyperledger Caliper) in caliper-workspace
This suite uses Hyperledger Caliper to send a high volume of transactions to the ConsentContract smart contract and measure the network's performance.
- Setup
Before running the benchmark, you must complete two setup steps:
Ensure your Fabric network is running.
Create the portal identity. Navigate to your ClinConNet-Portal/server directory and run the enrollment script to ensure the identity exists in the wallet that Caliper will use.
Bash
# In your ClinConNet-Portal/server directory
node enrollPortalUser.js
- Configuration
The configuration is spread across three files inside caliper-workspace/:
networks/fabric-connection.yaml: Verify that the absolute paths to your wallet and connection-org1.json are correct.
benchmarks/clinconnetConfig.yaml: Defines the test rounds, including the number of transactions and the target send rate (TPS).
workloads/clinconnetWorkload.js: Contains the logic for calling the smart contract functions (recordConsentProof, revokeConsentProof, queryConsentProof).
[current paths use the home/username/PATH, remove that when you reproduce this]
-
Execution
Navigate into the Caliper workspace directory: Bash
cd caliper-workspace
Install the local dependencies (Caliper CLI and Fabric SDK): Bash
npm install
Run the benchmark using the script defined in package.json: Bash
npm run benchmark
- Output
Caliper will execute all the test rounds and generate a detailed report.html file in the caliper-workspace directory. This interactive report contains a full breakdown of the performance metrics. In /Perf-results/blockchain-test-results we provide 3 test results. Two under stress conditions and one under extreme stress.