A serverless solution for monitoring RPC nodes response time across different blockchains and regions using Vercel Functions and Grafana Cloud. The project collects metrics from HTTP/WS endpoints for multiple blockchains and pushes them to Grafana Cloud for visualization.
📚 Public RPC Dashboard Documentation
- 🌐 Multi-region monitoring: US West, Germany, Singapore
- 📊 Real-time metrics visualization in Grafana Cloud
- 🔗 Support for multiple blockchains:
- Ethereum
- Base
- Solana
- TON
- Serverless functions run every minute in configured regions
- Metrics are collected and pushed to Grafana Cloud
- Authentication for production endpoints using
CRON_SECRET
- Preview deployments for testing with
SKIP_AUTH
- Fork this repository
- Click the "Deploy with Vercel" button above
- Configure the required environment variables (see below)
- Deploy!
To monitor RPC providers from multiple regions:
-
Create three separate Vercel projects for different regions:
- Project 1:
your-project-iad1
(US East) - Project 2:
your-project-sfo1
(US West) - Project 3:
your-project-hkg1
(Asia)
- Project 1:
-
Link each project to the same repository
-
Configure region override in each project:
- Project Settings → Functions → Function Region
- Select the corresponding region (iad1/sfo1/hkg1)
-
Configure shared environment variables:
- Team Settings → Environment Variables → Link To Projects
# Grafana Cloud configuration
GRAFANA_URL=https://influx-...-east-0.grafana.net/api/v1/push/influx/write
GRAFANA_USER=your_grafana_user_id
GRAFANA_API_KEY=your_grafana_api_key
# Monitoring configuration
METRIC_NAME=response_latency_seconds
METRIC_REQUEST_TIMEOUT=35
METRIC_MAX_LATENCY=35
# Security
CRON_SECRET=your_production_cron_secret # Required for production
SKIP_AUTH=FALSE # Should be FALSE in production
# RPC configuration
ENDPOINTS={"providers":[{"blockchain":"Ethereum","name":"Provider1"...}]}
For development and testing:
METRIC_NAME=test_response_latency_seconds # Add prefix to avoid metric conflicts
SKIP_AUTH=TRUE # Allows direct URL access
- Clone and setup:
git clone https://github.com/chainstacklabs/chainstack-rpc-dashboard-functions.git
cd chainstack-rpc-dashboard-functions
- Create and activate virtual environment:
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate
- Configure environment:
cp .env.local.example .env.local # Update with your values
cp endpoints.json.example endpoints.json
- Install dependencies:
pip install -r requirements.txt
- Run development server:
python run_local.py
- Test endpoints:
curl http://localhost:8000/api/chains/ethereum
Configure your RPC providers in endpoints.json
(for local development) or in ENDPOINTS
environment variable:
{
"providers": [
{
"blockchain": "Ethereum",
"name": "Chainstack-Free",
"region": "Global",
"websocket_endpoint": "wss://ethereum-mainnet.core.chainstack.com/...",
"http_endpoint": "https://ethereum-mainnet.core.chainstack.com/...",
"data": {}
}
]
}
.
├── api/ # Vercel Serverless Functions
│ └── chains/ # Blockchain-specific handlers
│ ├── base.py
│ ├── ethereum.py
│ ├── solana.py
│ └── ton.py
├── common/ # Shared utilities
│ ├── base_metric.py # Base metric collection
│ ├── factory.py # Metric factory pattern
│ ├── metric_config.py # Configuration classes
│ ├── metric_types.py # Metric type definitions
│ └── metrics_handler.py # Core metrics handler
├── metrics/ # Blockchain-specific metrics
│ ├── base.py
│ ├── ethereum.py
│ ├── solana.py
│ └── ton.py
└── config files... # Configuration and setup files
- Fork the repository
- Create a feature branch (
git checkout -b feature/YourFeature
) - Commit your changes (
git commit -am 'Add YourFeature'
) - Push to the branch (
git push origin feature/YourFeature
) - Create a Pull Request