Skip to content

Measure and compare the performance of different Ethereum WebSocket (WS) RPC providers by monitoring how quickly they broadcast new block events.

Notifications You must be signed in to change notification settings

Aero25x/rpc-speed-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Join our Telegram RU GitHub Twitter YouTube Reddit Join our Telegram ENG

image

🚀 Ethereum RPC's Speed Test

Measure and compare the performance of different Ethereum WebSocket (WS) RPC providers by monitoring how quickly they broadcast new block events.

Developed by Aero25x.


📌 Features

  • Connects to multiple Ethereum RPC WebSocket endpoints
  • Subscribes to new block headers (eth_subscribe)
  • Logs the time each provider receives a new block
  • Ranks providers based on first notification time
  • Provides block count statistics over a customizable duration
  • CLI interface for test duration

🛠️ Installation

Requirements

  • Python 3.7+

  • Dependencies:

    pip install websockets

Optional: Use a virtual environment for isolation:

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

⚙️ Configuration

Open the script and edit the RPC_PROVIDERS list. Replace <API_KEY> placeholders with your actual keys:

RPC_PROVIDERS = [
    RPCProvider(
        name="Alchemy",
        ws_url="wss://eth-mainnet.g.alchemy.com/v2/<API_KEY>"
    ),
    ...
]

❗ Some providers require an API key or project ID. Make sure it's active and has WS access.


▶️ Usage

Run the script:

python rpc_speed_test.py

You’ll be prompted to enter a test duration in minutes (default is 5). The script will then connect to each provider, listen for new blocks, and display the results.


🧪 Sample Output

🏆 RANKING BY FIRST BLOCK NOTIFICATION:
1. Alchemy
   First block: #17945231
   Total blocks received: 23
   Delay from fastest: 0.000s

2. QuickNode
   First block: #17945231
   Total blocks received: 22
   Delay from fastest: 0.224s

...

📊 SUMMARY:
Fastest provider: Alchemy
Total providers tested: 4
Average blocks received: 21.5

🧠 How It Works

  • Uses WebSocket connections to subscribe to newHeads
  • Measures time of first block notification per provider
  • Accumulates total block notifications over the duration
  • Ranks and compares performance

📎 Notes

  • This tool is designed for educational and diagnostic purposes.
  • Provider speeds may vary due to region, load, and network latency.
  • Add or remove providers by modifying the RPC_PROVIDERS list.

🙋‍♂️ Author

Aero25x

📬 Telegram: @hidden_coding


📄 License

This project is released under the MIT License. Feel free to use and modify it for your own benchmarking needs.

🏆 RANKING BY FIRST BLOCK NOTIFICATION:
----------------------------------------


      _    _ _     _     _             _____          _
     | |  | (_)   | |   | |           / ____|        | |
     | |__| |_  __| | __| | ___ _ __ | |     ___   __| | ___
     |  __  | |/ _` |/ _` |/ _ \ '_ \| |    / _ \ / _` |/ _ \
     | |  | | | (_| | (_| |  __/ | | | |___| (_) | (_| |  __/
     |_|  |_|_|\__,_|\__,_|\___|_| |_|\_____\___/ \__,_|\___|

                 SpeedTest by Aero25x

               Join us to get more scripts
               https://t.me/hidden_coding


1. QuickNode
   First block: #23195245
   Total blocks received: 5
   Delay from fastest: 0.000s

2. Alchemy
   First block: #23195245
   Total blocks received: 5
   Delay from fastest: 0.089s

📊 SUMMARY:
Fastest provider: QuickNode
Total providers tested: 2
Average blocks received: 5.0

Join our Telegram RU GitHub Twitter YouTube Reddit Join our Telegram ENG

About

Measure and compare the performance of different Ethereum WebSocket (WS) RPC providers by monitoring how quickly they broadcast new block events.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages