A command-line tool for benchmarking the latency of Ethereum RPC endpoints.
Install directly from crates.io using Cargo:
cargo install chain-pingPing a single endpoint to check its latency:
chain-ping https://eth.llamarpc.comCompare multiple providers to find the fastest one. By default, it pings each endpoint 4 times.
chain-ping https://eth.llamarpc.com https://rpc.ankr.com/eth https://1rpc.io/ethPing each endpoint 10 times with a strict 2-second timeout
chain-ping --pings 10 --timeout 2 https://eth.llamarpc.com https://rpc.ankr.com/eth Output the results as JSON for use in scripts:
chain-ping --format json https://eth.llamarpc.com > results.json+-------------------------+-----------+-------------+-------------+-------------+---------+--------------+------------+
| Endpoint | Status | Avg Latency | Min | Max | Success | Block Number | Last Error |
+=====================================================================================================================+
| https://eth.llamarpc... | SUCCESS | 145ms | 140ms | 152ms | 4/4 | "0x16bb624 | - |
| https://rpc.ankr.com... | FAILURE | - | - | - | 0/4 | - | JSON-RPC...|
+-------------------------+-----------+-------------+-------------+-------------+---------+--------------+------------+
[
{
"endpoint": "https://eth.llamarpc.com",
"avg_latency_ms": 145,
"min_latency_ms": 140,
"max_latency_ms": 152,
"status": "Success",
"block_number": "0x16bb624",
"success_count": 4,
"ping_count": 4,
"error_message": null
}
]This project is licensed under the MIT License.