A fast, efficient, and reliable Ethereum / EVM Throughput Benchmarking Tool.
Railgun is a command-line tool designed to stress test Ethereum-compatible networks by sending large batches of transactions and measuring throughput. It provides detailed metrics including transactions per second (TPS), block inclusion rates, gas usage, and timing analysis.
- Concurrent Batch Sending: Send multiple transaction batches concurrently with configurable concurrency limits
- Intelligent Receipt Polling: Automatically polls for transaction receipts with configurable intervals
- Detailed Metrics: Block-by-block analysis with TPS calculations, gas usage, and timing data
- Flexible Configuration: Configure RPC endpoints, chain IDs, batch sizes, delays, and more
- Real-time Progress Tracking: Monitor transaction submission and confirmation in real-time
- Accurate TPS Calculation: Calculates overall TPS based on actual block timestamps
- Go 1.25.1 or later
- Access to an Ethereum-compatible RPC endpoint
- A funded wallet (default: Foundry test mnemonic)
git clone https://github.com/sledro/railgun
cd railgun
go buildgo install github.com/sledro/railgun@latestRun a TPS benchmark with default settings (50 ETH transfers, batch size of 10):
railgun tps -r https://rpc.example.comrailgun tps \
--rpc https://rpc.example.com \
--txCount 1000 \
--batchSize 100 \
--batchDelay 100 \
--concurrency 10| Flag | Alias | Default | Description |
|---|---|---|---|
--rpc |
-r |
required | Ethereum RPC URL |
--txCount |
-t |
50 |
Number of transactions to send |
--batchSize |
-b |
10 |
Number of transactions per batch |
--batchDelay |
-d |
10 |
Delay between batches (milliseconds) |
--concurrent |
-c |
1 |
Concurrent batch sends: 1=sequential with delays, >1=parallel (max 50) |
--accounts |
-a |
1 |
Number of sender accounts for parallel nonce management |
--mnemonic |
-m |
(below) | BIP39 mnemonic phrase (see default below) |
--privatekey |
-k |
(empty) | Private key hex (takes precedence over mnemonic) |
Default Mnemonic (Foundry/Anvil test mnemonic):
test test test test test test test test test test test junkRailgun sends standard ETH transfer transactions to benchmark network throughput:
- To: Sender's own address (funds not lost, only gas spent)
- Value: 1000 wei
- Gas Limit: 21,000
- Gas Fees: 1 gwei tip, 20 gwei fee cap
# Light test
railgun tps -r https://rpc.example.com -t 100
# Stress test
railgun tps -r https://rpc.example.com -t 50000 -b 5000 -c 10railgun version
# or
railgun vRailgun produces a comprehensive report with two main sections:
=== TRANSACTION SUMMARY ===
Total Submitted: 1000
Confirmed: 987
Failed: 13
Elapsed Time: 4.52s- Total Submitted: Number of transactions sent to the network
- Confirmed: Transactions successfully mined in blocks
- Failed: Transactions that failed to send or were rejected
- Elapsed Time: Total time from start to finish
=== BLOCK REPORT ===
Block TxCount GasUsed% GasUsed Timestamp TPS
--------------------------------------------------------------------------------
1234567 329 45.23 45230000 14:32:01 329.00
1234568 331 46.10 46100000 14:32:02 331.00
1234569 327 44.87 44870000 14:32:03 327.00
--------------------------------------------------------------------------------
Total Blocks: 3
Avg Tx/Block: 329.00
Min Tx/Block: 327
Max Tx/Block: 331
Overall TPS: 329.00
===================- Block: Block number containing your transactions
- TxCount: Number of your transactions in this block
- GasUsed%: Percentage of block gas limit used
- GasUsed: Total gas used by the block
- Timestamp: Block creation time
- TPS: Transactions per second for this block
- Overall TPS: Average TPS calculated from
(total confirmed txs) / (last block time - first block time)
Railgun is organized into modular components:
- Generator (
railgun/generator.go): Creates signed transactions with random sender addresses - Sender (
railgun/sender.go): Manages concurrent batch sending with rate limiting - Reporter (
railgun/reporter.go): Polls for receipts and generates performance reports - Ethereum Client (
ethereum/ethereum.go): Handles RPC communication and batch operations
- Generation Phase: Creates all transactions upfront with unique random sender addresses
- Sending Phase: Sends batches concurrently with controlled concurrency and optional delays
- Polling Phase: Actively polls for transaction receipts until all are confirmed or timeout
- Reporting Phase: Analyzes block inclusion and calculates comprehensive metrics
This typically means:
- The network requires non-zero gas fees
- Try reducing concurrency:
--concurrency 2 - Increase batch delay:
--batchDelay 100
- Verify RPC URL is correct and accessible
- Check firewall settings
- Ensure the RPC endpoint supports the required methods
- Verify the chain ID matches your network
- Check that your account has sufficient funds
- Note: Railgun uses stall detection (exits if no new confirmations for 30 seconds)
- Reduce
--batchDelayto send batches faster - Increase
--concurrencyto send more batches in parallel - Check network capacity and block time
- Break large tests into smaller batches
- Reduce
--concurrencyto limit parallel operations - Monitor system resources
go build -o railgungo test ./...Contributions are welcome! Please feel free to submit issues or pull requests.