Linea RPC Proxy and Caching
eRPC is a fault-tolerant EVM RPC proxy and re-org aware permanent caching solution. It is built with read-heavy use-cases in mind such as data indexing and high-load frontend usage.
Features
✅ Fault-tolerant Proxy: Retries, circuit-breakers, failovers and hedged requests make sure fastest most-reliable upstream is used.
✅ Flexible Rate-limiters: Define hourly, daily rate limits for each upstream provider, to control usage, costs and high-scale usage.
✅ Permanent Caching: Avoid redundant upstream costs by locally caching RPC responses, with reorg-aware caching layer.
✅ Request Auto-routing: You don't need to think about which upstream supports which eth_* method; eRPC automatically does that.
✅ Normalized Errors: Receive consistent error codes with details across 5+ third-party providers. With useful reporting of occurred errors.
✅ RPC Metrics & Observability: Single dashboard to observe rps throughput, errors, and avg. latency of all your RPC providers.
Quick start
- Create your
erpc.yaml
configuration file based on theerpc.yaml.dist
file:
cp erpc.yaml.dist erpc.yaml
code erpc.yaml
See a complete config example for inspiration.
- Use the Docker image:
docker run -v $(pwd)/erpc.yaml:/root/erpc.yaml -p 4000:4000 -p 4001:4001 ghcr.io/erpc/erpc:latest
- Send your first request:
curl --location 'http://localhost:4000/main/evm/59144' \
--header 'Content-Type: application/json' \
--data '{
"method": "eth_getBlockByNumber",
"params": [
"0x7340c3",
false
],
"id": 9199,
"jsonrpc": "2.0"
}'
- Bring up monitoring stack (Prometheus, Grafana) using docker-compose:
# clone the repo if you haven't
git clone https://github.com/erpc/erpc.git
cd erpc
# bring up the monitoring stack
docker-compose up -d
- Open Grafana at http://localhost:3000 and login with the following credentials:
- username:
admin
- password:
admin
- Send more requests and watch the metrics being collected and visualized in Grafana.