• Homepage •
Supported protocols •
Chainstack blog •
Blockchain API reference •
• Agents •
Start for free •
This tutorial shows a hybrid RPC setup: run your own full node for the bulk of your RPC traffic,
and let eRPC transparently route what your node can't serve — archive
state, trace_*, and debug_* — to a Chainstack Cloud archive node. Your apps see one endpoint;
recent calls are served by your self-hosted node at flat hardware cost, and you pay for archive only
when you actually need it.
The worked example runs on Ethereum Hoodi — a testnet that's cheap to self-host and fits a small
box — but the pattern is chain-agnostic. The same eRPC config with a different chainId works on any
EVM network from the protocols supported by Chainstack Self-Hosted,
and mainnets like Ethereum or Base are where the cost savings land.
The three moving parts:
- Full node — keeps recent chain state. Cheap to run, and covers ~95% of typical app traffic: balances, transactions, logs, contract calls at recent blocks.
- Archive node — keeps all historical state. Expensive to self-host (multi-TB disk, long sync),
but required for
trace_*,debug_*, and state reads at old blocks. - eRPC — an open-source RPC proxy that sits in front of both. It routes each request by method, fails over when the full node errors (for example, on pruned state), and caches finalized results so repeat archive hits cost nothing.
The hybrid idea: self-host the cheap full node, rent the expensive archive as a managed Chainstack node, and let eRPC decide per request. You get one endpoint and the cheapest viable path for every call.
Suggested path through this repo:
- Read the tutorial — the full walkthrough, built and verified on a real server, including the gotchas we hit.
- Skim
erpc/erpc.yaml— the entire routing logic is ~60 commented lines.
- A bare-metal server with Chainstack Self-Hosted. Any provider works; the partner providers offer discounts and ship the Control Panel pre-installed. The worked example uses a Velia box — see the tutorial for the exact config and promo code.
- A Chainstack account for the Cloud archive node.
- Docker on the server, for eRPC.
- Buy a small box and harden it (see the tutorial). Hoodi is light: ~6 vCPU, 32 GB RAM, and ~500 GB NVMe is plenty.
- Deploy the Hoodi full node (Chainstack Self-Hosted) and a Chainstack Cloud Hoodi archive node.
- On the box, copy
.env.exampleto.envand fill in your endpoints.SELF_HOSTED_RPC_URLis the node'sreth-rpcClusterIP (routable from the k3s host):kubectl -n control-panel-deployments get svc | grep reth-rpc - Run eRPC on the box with host networking, so it reaches the node over the cluster network while
its ports 4000/4001 stay firewalled from the internet:
docker run -d --name erpc --restart unless-stopped --network host \ -v $(pwd)/erpc/erpc.yaml:/erpc.yaml --env-file .env ghcr.io/erpc/erpc:main - Prove the routing split (on the box):
./scripts/test-routing.sh && ./scripts/verify.sh
tutorial/— the full walkthrough (canonical source for all derived content).erpc/erpc.yaml— the working eRPC config.scripts/— verification that recent calls are served by the self-hosted node and archive calls hit Cloud.
Swap the chainId in erpc/erpc.yaml and .env, deploy the matching self-hosted node and Cloud
archive node, and the routing works unchanged. See the
supported clients and protocols
for what Chainstack Self-Hosted can run, and the
networks list for what's available on
Chainstack Cloud. Note that eRPC routes EVM chains only.
