Deploy eRPC

Fault-tolerant EVM RPC proxy with Postgres cache, auth and Grafana

Deploy eRPC

Just deployed

/prometheus

Just deployed

/var/lib/grafana

/var/lib/postgresql/data

Deploy and Host eRPC on Railway

eRPC is an open-source, fault-tolerant proxy for EVM JSON-RPC. It sits in front of one or more RPC providers, retries and hedges failed or slow calls, fails over between upstreams, enforces rate limits and caches responses, so indexers, backends and frontends get fewer errors and lower provider bills. It is written in Go and licensed Apache-2.0.

About Hosting eRPC

This template deploys eRPC 0.5.0 from a public GitHub repo with the official image pinned by digest, plus Railway Postgres, Prometheus 3.13 and Grafana 12.4. eRPC gets a public HTTPS URL and a health check on /healthcheck. Every RPC call needs the generated ERPC_SECRET_TOKEN, so the URL is not an open relay. Finalized responses are cached in Postgres and survive redeploys; recent blocks are cached in memory. Prometheus scrapes eRPC over the private network and keeps its data on a volume. Grafana loads eRPC's official dashboard, keeps its data on a volume and has a generated admin password. Out of the box eRPC uses free public endpoints for every supported chain, so no API key is needed.

Common Use Cases

  • One RPC URL with automatic failover and retries for blockchain indexers such as Ponder, Envio or Subsquid
  • Caching repeated eth_getLogs, block and receipt calls to cut paid RPC provider usage
  • Combining free public endpoints and paid providers (Alchemy, QuickNode, your own nodes) behind one authenticated endpoint, with metrics in Grafana

Dependencies for eRPC Hosting

  • PostgreSQL (Railway Postgres, included) for the persistent response cache
  • Prometheus and Grafana (included) for metrics and the eRPC dashboard

Deployment Dependencies

Implementation Details

After deploy, open the eRPC service's Variables tab and copy ERPC_SECRET_TOKEN. Then call:

curl -X POST "https://YOUR-ERPC-DOMAIN/evm/1?secret=YOUR-SECRET" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'

Replace 1 with any chain ID (for example 8453 for Base). You can also send the token in the X-ERPC-Secret-Token header. Other services in the same project can call eRPC over the private network on its private domain, port 4000, instead of the public URL.

Grafana: open the Grafana service's domain and log in as admin with GF_SECURITY_ADMIN_PASSWORD from its Variables tab. The eRPC dashboard is the home page.

To add your own providers or change caching, fork the template repo, edit erpc/erpc.yaml (keep API keys in Railway variables and reference them as ${VAR}), and point the eRPC service at your fork. Updates: when a new eRPC version is merged into the template repo, Railway shows an update notice in your project; read the repo's CHANGELOG.md first. Your cache, metrics and Grafana data stay on their volumes.

Why Deploy eRPC on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying eRPC on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
51
View Template
Foundry Virtual Tabletop
Self-hosted virtual tabletop for role-playing games (license required)

Lucas
71
View Template
NEW
Double Commander in your browser
The Double Commander file manager in the cloud, from any device

Nermin Sabanovic
0