This guide will help you get started with the Ethereum JSON-RPC Benchmarking Suite.
- Docker and Docker Compose
- Go 1.20 or later
- k6 (for load testing)
You can start the Ethereum client nodes using Docker Compose:
# Start Geth
docker-compose -f clients/geth/docker-compose.yml up -d
# Start Nethermind
docker-compose -f clients/nethermind/docker-compose.yml up -dUse the Go CLI tool to run a benchmark:
# Build the benchmark tool
go build -o benchmark ./runner/main.go
# Run a benchmark with a predefined configuration
./benchmark -config ./config/benchmark/read-heavy.yamlAfter running a benchmark, you can view the HTML report:
# Start the report server
go run ./web/serve.go
# Open the report in your browser
open http://localhost:8080/report/latestThe benchmark suite uses YAML files for configuration. Here's an example:
test_name: "Read-heavy RPC benchmark"
description: "Benchmark focusing on read operations like eth_call and eth_getLogs"
clients:
- name: "geth"
url: "http://localhost:8545"
- name: "nethermind"
url: "http://localhost:8545"
duration: "5m"
rps: 200
endpoints:
- method: "eth_call"
params:
- to: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
data: "0x70a08231000000000000000000000000000000000000000000000000000000000000000a"
frequency: 60%
- method: "eth_getLogs"
params:
- fromBlock: "0x1000000"
toBlock: "0x1000100"
address: ["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"]
frequency: 30%
- method: "eth_getBlockByNumber"
params:
- "latest"
- true
frequency: 10%
validate_responses: trueYou can start the entire benchmarking stack using the main Docker Compose file:
docker-compose up -dThis will start:
- Ethereum clients (Geth and Nethermind)
- Prometheus for metrics collection
- Grafana for metrics visualization
- A web server for viewing HTML reports
Access the Grafana dashboard at http://localhost:3000 (default credentials: admin/admin).
To add a new client:
- Create a new Docker Compose file in the
clients/directory - Add the client to your YAML configuration files
- Update the main Docker Compose file to include the new client
You can create custom test scenarios by creating new YAML configuration files in the config/ directory.
The benchmark suite can validate responses from different clients to identify inconsistencies. Enable this feature by setting validate_responses: true in your YAML configuration.
- If clients are not accessible, check that they are running and that the URLs in your configuration are correct
- If k6 fails to run, ensure it's installed and in your PATH
- For Docker-related issues, check the container logs using
docker-compose logs