https://github.com/0xonkel/solana-rpc-bench
Benchmark Solana RPCs with real calls
https://github.com/0xonkel/solana-rpc-bench
rpc solana
Last synced: about 1 year ago
JSON representation
Benchmark Solana RPCs with real calls
- Host: GitHub
- URL: https://github.com/0xonkel/solana-rpc-bench
- Owner: 0xOnkel
- License: mit
- Created: 2025-04-16T18:07:39.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-24T18:01:23.000Z (about 1 year ago)
- Last Synced: 2025-04-24T19:22:08.548Z (about 1 year ago)
- Topics: rpc, solana
- Language: Rust
- Homepage:
- Size: 134 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Config
Provide a `config.toml` file which contains the RPCs that should be checked.
```toml
[[rpc]]
label = "Solana.com"
url = "https://api.mainnet-beta.solana.com"
[[rpc]]
label = "Helius"
url = "https://mainnet.helius-rpc.com/?api-key="
```
## Change # of repeats
By default, the test is run 3 times for each call. This can be changed with
setting the `repeat` variable in the `config.toml` file.
```toml
repeat = 5
```
# Usage
Just run the script with `cargo run --release` and you will get an output like
```
╭────────────┬───────────────────────┬────────┬────────┬────────╮
│ RPC │ Call │ Avg │ Best │ Worst │
├────────────┼───────────────────────┼────────┼────────┼────────┤
│ Solana.com │ get_slot │ 103 ms │ 103 ms │ 103 ms │
├────────────┼───────────────────────┼────────┼────────┼────────┤
│ Solana.com │ get_multiple_accounts │ 74 ms │ 74 ms │ 74 ms │
├────────────┼───────────────────────┼────────┼────────┼────────┤
│ Helius │ get_slot │ 124 ms │ 124 ms │ 124 ms │
├────────────┼───────────────────────┼────────┼────────┼────────┤
│ Helius │ get_multiple_accounts │ 105 ms │ 105 ms │ 105 ms │
├────────────┼───────────────────────┼────────┼────────┼────────┤
│ Quicknode │ get_slot │ 111 ms │ 111 ms │ 111 ms │
├────────────┼───────────────────────┼────────┼────────┼────────┤
│ Quicknode │ get_multiple_accounts │ 77 ms │ 77 ms │ 77 ms │
╰────────────┴───────────────────────┴────────┴────────┴────────╯
```