What is Chainbench?
Chainbench is a flexible blockchain infrastructure benchmarking tool that allows you to load test and analyze the performance of blockchain nodes and RPC endpoints. Built on top of Locust, it provides an intuitive CLI interface for testing any EVM-compatible blockchain, Solana, and partial support for Starknet.Chainbench is developed by Chainstack, the leading suite of services connecting developers with Web3 infrastructure.
Key Features
Built-in Protocol Support
Chainbench comes with pre-configured profiles for major blockchain networks:- EVM-compatible chains: Ethereum, Binance Smart Chain, Polygon, Base, Arbitrum, Avalanche, Fantom, Gnosis, Oasis, Optimism, and Ronin
- Non-EVM chains: Solana and Starknet (partial support)
- Generic profiles:
evm.lightandevm.heavyfor any EVM-compatible chain
Dynamic Test Data Generation
Instead of using hardcoded values, Chainbench fetches real blockchain data to use as test parameters:- Automatically retrieves block numbers, hashes, transactions, and addresses
- Supports custom block ranges for test data
- Option to use latest blocks for nodes with limited history
- Configurable test data sizes (XS to XL)
Flexible Load Patterns
Control how load is distributed over time:- Ramp-up: Linear increase to target user count
- Step: Incremental load increases in defined steps
- Spike: Burst testing with sudden load spikes
- Custom load shapes can be added
Multiple Testing Modes
- Headless mode: Automated testing ideal for CI/CD pipelines
- Web UI mode: Interactive dashboard for real-time monitoring and control
- Batch mode: Send multiple requests in a single batch request
- Single method testing: Focus on specific RPC methods
Custom Profile Creation
Easily create custom profiles for specific testing scenarios:- Python-based profile definition
- Built-in parameter factories for common RPC methods
- Support for static and dynamic call parameters
- Task weighting for realistic workload simulation
Use Cases
Infrastructure Performance Testing
Benchmark your blockchain nodes to understand their capacity:RPC Endpoint Validation
Discover which methods are available on an endpoint:Sync Mode Testing
Test nodes running in limited sync modes using latest blocks:Load Testing with Monitoring
Collect additional metrics like sync lag during tests:Architecture Overview
Chainbench is built on a distributed architecture leveraging Locust:Master-Worker Model
- Master process: Coordinates the test, collects metrics, and provides web UI
- Worker processes: Generate load by simulating users making RPC calls
- Scalable to multiple workers for high-load testing
Test Data Layer
Before tests begin, Chainbench:- Connects to the target (or reference) node
- Fetches the chain ID to determine the blockchain
- Retrieves test data based on configured size (blocks, transactions, addresses)
- Distributes this data to all workers for consistent testing
User Classes and Tasks
Profiles define user classes that:- Inherit from base classes (
EvmUser,SolanaUser) - Contain tasks decorated with
@taskrepresenting RPC methods - Use parameter factories to generate realistic request data
- Support task weighting for workload distribution
Results and Metrics
Test results are saved to the./results/ directory by default:
- Request statistics (response times, failure rates)
- Per-method performance metrics
- CSV exports for further analysis
- Optional TimescaleDB integration for time-series data
Next Steps
Installation
Get Chainbench installed with pip or Poetry
Quickstart
Run your first benchmark in minutes