MCPcopy Index your code
hub / github.com/erpc/erpc

github.com/erpc/erpc @0.1.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.1.1 ↗ · + Follow
5,075 symbols 29,301 edges 441 files 1,810 documented · 36% updated today0.1.1 · 2026-06-16★ 73520 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

eRPC Hero

Build Status Docs License Contributors Telegram

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.

Architecture Diagram


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:

npx start-erpc

Or, using Docker:

docker run -p 4000:4000 ghcr.io/erpc/erpc

Or, using Railway:

Deploy on Railway

Send a request to your eRPC instance:

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 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 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 and more
  • Smart batching: Aggregate multiple RPC or contract calls into one
  • Selection policy: Allows you to influence how upstreams are selected to serve traffic (or not) w/ selection policies.
  • Data integrity: Ensures accurate, up-to-date responses by levering several data integrity mechanisms.
  • Consensus policy: Compares results from multiple upstreams and punishes nodes that consistently disagree.

Case Studies


CLI Commands

eRPC provides several CLI commands beyond the default server start:

erpc validate <config-file>

Validate a configuration file (TS, JS, or YAML) and report any errors, warnings, or notices. Useful in CI pipelines to catch misconfigurations before deployment.

erpc validate erpc.yaml
erpc validate erpc.ts

erpc dump <config-file>

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.).

# 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:
git clone https://github.com/erpc/erpc.git
  1. Install Go dependencies:
make setup
  1. Create a configuration file:
cp erpc.dist.yaml erpc.yaml
vi erpc.yaml
  1. Run the eRPC server:
make run

Contributors

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

Extension points exported contracts — how you extend this code

Connector (Interface)
(no doc) [8 implementers]
data/connector.go
EvmStatePoller (Interface)
(no doc) [6 implementers]
common/architecture_evm.go
Upstream (Interface)
(no doc) [10 implementers]
common/upstream.go
AuthStrategy (Interface)
(no doc) [5 implementers]
auth/strategy.go
JsonRpcErrorExtractor (Interface)
JsonRpcErrorExtractor allows callers to inject architecture-specific JSON-RPC error normalization logic into HTTP client [2 …
common/error_extractor.go
ReleasableByteWriter (Interface)
ReleasableByteWriter extends ByteWriter with a Release method for cleanup. Implementations should use Release to free re [2 …
util/bytes.go
HistogramObservable (Interface)
HistogramObservable is satisfied by both *prometheus.HistogramVec and *LabeledHistogram, so ObserverHandle can cache han [1 …
telemetry/handles.go
ResponseMetadata (Interface)
(no doc) [3 implementers]
common/response.go

Core symbols most depended-on inside this repo

Run
called by 1142
erpc/network_executor.go
ResetGock
called by 1127
util/testing.go
SafeReadBody
called by 775
util/testing.go
NewNormalizedRequest
called by 676
common/request.go
Error
called by 623
common/errors.go
Load
called by 592
health/rolling.go
SetupMocksForEvmStatePoller
called by 503
util/testing.go
Forward
called by 335
common/network.go

Shape

Function 2,403
Method 1,871
Struct 519
Interface 223
TypeAlias 55
Class 2
FuncType 2

Languages

Go86%
TypeScript14%

Modules by API surface

common/errors.go202 symbols
common/config.go169 symbols
typescript/config/src/generated.ts89 symbols
typescript/config/lib/generated.d.ts89 symbols
architecture/evm/eth_query_test.go68 symbols
internal/policy/stdlib/stdlib_test.go65 symbols
health/tracker.go65 symbols
common/request.go63 symbols
typescript/config/src/types/policyEval.ts62 symbols
typescript/config/lib/types/policyEval.d.ts62 symbols
erpc/networks.go59 symbols
common/defaults.go59 symbols

Datastores touched

erpcDatabase · 1 repos
bogusdbDatabase · 1 repos
postgresDatabase · 1 repos
testdbDatabase · 1 repos

For agents

$ claude mcp add erpc \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact