Using eRPC with Chainstack: Quickstart
TLDR:
- Set up eRPC as a fault-tolerant proxy that automatically discovers and configures all your Chainstack nodes using the Platform API.
- Unlike other providers, Chainstack integration requires only a Platform API key to automatically fetch and configure all deployed nodes across multiple chains.
- Benefit from automatic node discovery, multi-chain support, smart filtering by project/region/provider, and dynamic configuration without manual endpoint management.
- Deploy using Docker with simple YAML configuration and test with standard JSON-RPC calls for production-ready blockchain infrastructure.
Main article
eRPC is a fault-tolerant EVM RPC proxy with permanent caching and reorg awareness. One of its most powerful features is the built-in support for multiple blockchain infrastructure providers, including Chainstack.
What makes Chainstack unique in eRPC?
Unlike other providers that require you to manually configure each blockchain network endpoint, Chainstack’s integration with eRPC uses the Chainstack Platform API to automatically discover and configure all your deployed nodes.
This means:
- Automatic node discovery — eRPC fetches all your Chainstack nodes via API.
- Multi-chain support — Automatically supports all chains where you have nodes.
- Smart filtering — Filter nodes by project, organization, region, provider, and type.
- Dynamic configuration — No need to manually update configs when you deploy new nodes.
This tutorial will guide you through setting up eRPC as a fault-tolerant proxy for your Chainstack RPC endpoints, providing enhanced reliability, caching, and failover capabilities.
Prerequisites
Before starting, ensure you have:
- A Chainstack account with deployed nodes.
- A Chainstack Platform API key.
- Docker installed.
And that’s about it.
You don’t need to clone the eRPC repository. This tutorial uses the pre-built Docker image and creates configuration files from scratch.
Step 1: Get your Chainstack Platform API key
The key difference with Chainstack is that you need a Platform API key, not a regular node endpoint API key.
Creating a Platform API key
- Log into your Chainstack console.
- Navigate to Settings > API keys.
- Click Create key.
- Give it a descriptive name (e.g., “eRPC Integration”).
- Copy the generated API key.
This is different from the authorization keys you get with individual node endpoints. The Platform API key lets eRPC discover and manage all your nodes automatically.
Step 2: Deploy nodes
Deploy Global Nodes for EVM networks.
For this tutorial, let’s deploy nodes on a few different networks: Ethereum Mainnet, Polygon Mainnet, Arbitrum Mainnet.
Step 3: Configure Chainstack integration
If you want a quick start, you can just stick with the basic configuration and explore other options later.
Basic configuration
Create or edit your erpc.yaml
file:
Replace YOUR_CHAINSTACK_PLATFORM_API_KEY
with your actual Platform API key.
Advanced configuration with filtering
Chainstack’s integration supports powerful filtering options:
Replace YOUR_CHAINSTACK_PLATFORM_API_KEY
with your actual Platform API key and PROJECT-ID
with the ID of your project—for example, PR-123-456
.
Step 4: Run eRPC
Start eRPC using Docker:
Step 5: Test your setup
Test the proxy with a simple request:
Advanced configuration
For more advanced configurations and features, refer to the eRPC documentation and the eRPC GitHub repository. Don’t forget to give them a star :star: for this awesome solution.