https://github.com/erpc/erpc
eRPC — fault-tolerant evm rpc proxy
https://github.com/erpc/erpc
cache erpc ethereum evm go load-balancer proxy rpc
Last synced: 5 days ago
JSON representation
eRPC — fault-tolerant evm rpc proxy
- Host: GitHub
- URL: https://github.com/erpc/erpc
- Owner: erpc
- License: apache-2.0
- Created: 2024-05-06T10:32:04.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-06T15:59:34.000Z (about 1 year ago)
- Last Synced: 2025-04-06T16:31:23.828Z (about 1 year ago)
- Topics: cache, erpc, ethereum, evm, go, load-balancer, proxy, rpc
- Language: Go
- Homepage: https://docs.erpc.cloud
- Size: 36.5 MB
- Stars: 427
- Watchers: 9
- Forks: 31
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-evm-data-tools - ERPC - Fault-tolerant evm rpc proxy (Infrastructure)
- awesome-web3 - eRPC - Open-source EVM RPC proxy & cache service built to scale horizontally from small traffic to million RPS across many chains, optimized for read-heavy use-cases such as Indexers, Frontends, MEV bots, etc. (Software Development / Go)
README
[](https://github.com/erpc/erpc/actions/workflows/release.yml)
[](https://docs.erpc.cloud/)
[](https://github.com/erpc/erpc/blob/main/LICENSE)
[](https://github.com/erpc/erpc/graphs/contributors)
[](https://t.me/erpc_cloud)
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.

---
### Quick Start
With the below setup, you get immediate access to 2,000+ chains and 4,000+ public free EVM RPC endpoints.
#### Run an eRPC instance:
Using `npx`:
```bash
npx start-erpc
```
Or, using `Docker`:
```bash
docker run -p 4000:4000 ghcr.io/erpc/erpc
```
Or, using `Railway`:
[](https://railway.com/template/10iW1q?referralCode=PpPFJd)
#### Send a request to your eRPC instance:
```bash
curl 'http://localhost:4000/main/evm/42161' \
--header 'Content-Type: application/json' \
--data '{
"method": "eth_getBlockByNumber",
"params": ["latest", false],
"id": 9199,
"jsonrpc": "2.0"
}'
```
#### Next Steps:
This setup is ideal for development and testing purposes. For production environments, we recommend extending your configuration with dedicated premium providers and advanced failover settings. See our [Configuration Guide](https://docs.erpc.cloud/config/example) for more details.
---
### Key Features
- **Retries, circuit breakers, failovers, and hedged requests**: Ensures the fastest, most reliable upstream is always used
- **Configurable rate limits**: Set hourly or daily [rate limits](https://docs.erpc.cloud/config/rate-limiters) per upstream to control usage and costs
- **Local re-org aware cache**: Avoid redundant upstream calls and maintain data consistency when blockchain reorgs occur
- **Automatic method routing**: No need to worry which provider supports which `eth_*` method
- **Unified error handling**: Consistent error codes and detailed messages across multiple providers
- **Single dashboard**: Observe throughput (RPS), errors, and average latency across all providers
- **Flexible authentication**: Supports [basic auth, secrets, JWT, SIWE](https://docs.erpc.cloud/config/auth) and more
- **Smart batching**: [Aggregate multiple RPC or contract calls into one](https://docs.erpc.cloud/operation/batch)
- **Selection policy**: Allows you to influence how upstreams are selected to serve traffic (or not) w/ [selection policies](https://docs.erpc.cloud/config/projects/selection-policies).
- **Data integrity**: Ensures accurate, up-to-date responses by levering several [data integrity mechanisms](https://docs.erpc.cloud/config/failsafe/integrity).
- **Consensus policy**: Compares results from multiple upstreams and punishes nodes that consistently disagree.
---
### Case Studies
- 🔵 [Moonwell: How eRPC slashed RPC calls by 67%](https://erpc.cloud/case-studies/moonwell)
- 🟢 [Chronicle: How eRPC reduced RPC cost by 45%](https://erpc.cloud/case-studies/chronicle)
---
### CLI Commands
eRPC provides several CLI commands beyond the default server start:
#### `erpc validate `
Validate a configuration file (TS, JS, or YAML) and report any errors, warnings, or notices. Useful in CI pipelines to catch misconfigurations before deployment.
```bash
erpc validate erpc.yaml
erpc validate erpc.ts
```
#### `erpc dump `
Parse a configuration file and output the fully resolved configuration with all eRPC defaults applied. Supports YAML and JSON output. This is useful for inspecting what your final config looks like after eRPC fills in all default values (retry policies, timeouts, selection policies, etc.).
```bash
# Output as YAML (default)
erpc dump erpc.yaml
# Output as JSON
erpc dump --format json erpc.ts
# Compare two configs (e.g. before/after a migration)
diff <(erpc dump old-config.yaml) <(erpc dump new-config.yaml)
```
---
### Local Development
1. **Clone this repository:**
```bash
git clone https://github.com/erpc/erpc.git
```
2. **Install Go dependencies:**
```bash
make setup
```
3. **Create a configuration file:**
```bash
cp erpc.dist.yaml erpc.yaml
vi erpc.yaml
```
4. **Run the eRPC server:**
```bash
make run
```
---
### Contributors
By contributing to this project, you agree that your contributions may be used in both the open-source and enterprise versions of the software. Please review our
Contributing Guidelines and
Contributor License Agreement before submitting your contributions.
---
### License
Apache 2.0