A service for monitoring and reporting RPC endpoint uptime and performance metrics for the Celo blockchain networks (mainnet, baklava).
This project consists of:
- API Service: Express-based REST API for retrieving RPC uptime data
- Indexers: Services that collect and store RPC performance metrics
- Database: MySQL database for persistent storage
- Cache: Redis for API performance optimization
src/
├── index.ts # Main application entry point for Express API and routes
├── indexer/
│ ├── validator.ts # Validator group membership tracking
│ ├── rpc.ts # RPC functions
│ ├── types.ts # TypeScript type definitions for indexer
│ └── index.ts # Entrypoint for RPC indexer
├── service/
│ ├── blockchain.ts # Blockchain interaction service
│ ├── database.ts # Database access service
│ ├── Accounts.ts # Accounts ABI for naming validators
│ └── cache.ts # Caching service
├── utils/
│ ├── types.ts # TypeScript type definitions (shared across services)
│ ├── axios_util.ts # Axios utility functions
│ └── index.ts # Main utility functions
└── db/
│ ├── models/ # Sequelize models
│ └── index.ts # Main database service
└── .env.template # Environment variables
└── docker-compose.yml # Docker Compose configuration
└── Dockerfile # Dockerfile for building the Docker image
└── package.json # Node.js package configuration
└── tsconfig.json # TypeScript configuration
└── README.md # This file
└── yarn.lock # Yarn package lock file
└── .gitignore # Git ignore file
└── gitattributes # Git attributes
└── .prettierrc # Prettier configuration
└── prettierignore # Prettier ignore file
└── eslintignore # ESLint ignore file
└── eslintrc.js # ESLint configuration
└── LICENSE # License
└── .sequelizerc # Sequelize configuration
- REST API for querying RPC endpoint performance metrics
- Indexers for mainnet and baklava networks
- Health check endpoints
- Data filtering by time range and validator addresses
- Data export functionality
- Redis caching for improved performance
GET /:networkName/health- Health check for a specific networkGET /:networkName/rpcMeasurements- Get RPC performance measurementsGET /:networkName/exportRpcMeasurements- Export RPC measurements dataGET /:networkName/rpcValidators- Get validator to RPC endpoint mappings
- Clone the repository
- Install dependencies:
yarn - Create a
.envfile from.env.template - Run Redis locally:
docker run -p 6379:6379 -it redis/redis-stack-server:latest - Start the development server:
yarn dev
To run the entire stack (API, indexers, MySQL, Redis):
docker-compose up -d
This will start:
- API service on port 3006
- MySQL database
- Redis cache
- RPC indexers for mainnet and baklava networks
Key environment variables:
DB_HOST,DB_NAME,DB_USER,DB_PWD: Database connection detailsREDIS_URL: Redis connection stringMAINNET_EXTERNAL_NODE,BAKLAVA_EXTERNAL_NODE: RPC node URLsFORCE_SYNC: Whether to force database sync (boolean)RPC_TIMER_MS: Interval for RPC checks (default: 300000ms)CORS_URLS: Allowed CORS origins
- Fork the repository
- Create a feature branch
- Submit a pull request
This service is part of the Celo blockchain monitoring infrastructure and serves the Vido front-end and will be duplicated by Score Management committee members to have multiple sources of truth for RPC endpoint uptime and performance metrics.