Super RPC is a middleware for EVM RPCs, designed to augment and optimize RPC requests for reliability and speed, especially for subgraphs and indexers.
- Multi-Network Support: Configure multiple networks (e.g., Base, Optimism) via
config.yaml. - Performance:
- Keep-Alive: Connection pooling for low-latency upstream requests.
- Smart Throttling: Optimized duplicate request handling (100ms delay).
- Caching:
- Persistent Cache: SQLite-based caching.
- Immutable Data: Permanently caches
eth_chainId,net_version, etc.
- Fallback Mechanism: Switches to Archival Node if Primary returns errors.
- Production Logging: Structured logs with internal request tracing.
You can run the application using Docker Compose. This automatically handles dependencies and mounts the configuration file.
-
Prepare Configuration: ensure you have a
config.yamlfile (copy from example if needed).cp config.example.yaml config.yaml
-
Run with Docker Compose:
docker compose up -d --build
The application will be available at
http://localhost:4500. Data will be persisted in the./datadirectory.
npm install
npm run build- Copy the example configuration:
cp config.example.yaml config.yaml
- Edit
config.yamlto add your RPC endpoints:server: port: 4500 dbPath: "./cache.db" logLevel: "info" networks: - name: "base-mainnet" primary: "https://... (Full Node)" fallback: "https://... (Archival Node)"
Start the server:
npm start
# OR for development
npm run devSend requests to http://localhost:PORT/<network-name>:
curl -X POST -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
http://localhost:4500/base-mainnetRun the included test script:
./scripts/test_rpc.sh