Summary
ETH RPC (Remote Procedure Call) is the standard protocol for interacting with the Ethereum blockchain. This article explains what an ETH RPC endpoint is, how to use it with JSON-RPC methods, and how to choose a reliable provider for your dApp or infrastructure.
ETH RPC decision checklist
Before integrating an ETH RPC endpoint, evaluate these key criteria:
| Criterion | What to check | Why it matters |
|---|---|---|
| Endpoint type | Shared vs. dedicated node | Shared endpoints are cost-effective for low-volume apps; dedicated nodes provide consistent performance for high-throughput or latency-sensitive use cases. |
| Rate limits | Requests per second (RPS) and daily/monthly caps | Exceeding limits causes request failures; choose a plan that matches your peak traffic. |
| Archive data | Availability of archive node endpoints | Required for historical state queries (e.g., eth_call with older block numbers). |
| WebSocket support | WSS endpoint for real-time subscriptions | Essential for dApps that need live event streams (e.g., pending transactions, logs). |
| Geographic distribution | Global node locations | Reduces latency for users worldwide; improves dApp responsiveness. |
| Uptime SLA | Published uptime guarantees | Critical for production apps; look for providers with transparent monitoring. |
| Security | API key management, TLS, DDoS protection | Protects your endpoint from abuse and data interception. |
| Pricing model | Pay-as-you-go vs. subscription vs. free tier | Aligns cost with usage; free tiers are great for prototyping but may have strict limits. |
| Supported methods | Full JSON-RPC API coverage (eth_, net_, web3_) | Missing methods can break dApp functionality; verify archive and trace support if needed. |
| Failover | Automatic retry and multi-endpoint fallback | Ensures high availability; some providers offer built-in load balancing. |
What is an ETH RPC endpoint?
An ETH RPC endpoint is a URL that exposes the Ethereum JSON-RPC API, allowing external applications to read blockchain data and send transactions. Every Ethereum client (e.g., Geth, Nethermind, Erigon) implements this standard interface, so developers can interact with the network without running their own node.
RPC stands for Remote Procedure Call. In Ethereum, it uses JSON-RPC, a lightweight protocol that encodes requests and responses in JSON. The endpoint is typically an HTTP or WebSocket URL.
How to call an ETH RPC endpoint
You can call an ETH RPC endpoint using any HTTP client. Here's a curl example that gets the current block number:
curl https://eth-mainnet.g.alchemy.com/v2/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x134e8a0"
}
Common methods include:
eth_blockNumber– current block numbereth_getBalance– balance of an addresseth_call– execute a read-only contract calleth_sendRawTransaction– broadcast a signed transactioneth_getLogs– retrieve event logs
For WebSocket subscriptions, connect to a WSS endpoint and send subscription requests:
{"jsonrpc":"2.0","method":"eth_subscribe","params":["newHeads"],"id":1}
ETH RPC chain settings
To connect to Ethereum mainnet, you need the following chain details:
| Parameter | Value |
|---|---|
| Network Name | Ethereum Mainnet |
| RPC URL | Your provider's endpoint |
| Chain ID | 1 (0x1) |
| Currency Symbol | ETH |
| Block Explorer URL | https://etherscan.io |
These settings are used when configuring wallets like MetaMask or adding the network to your dApp.
Choosing an ETH RPC provider
When selecting a provider for production, consider:
- Shared vs. dedicated: Shared endpoints are cheaper but subject to noisy neighbors. Dedicated nodes offer isolated resources and predictable performance.
- Rate limits: Free tiers often cap at 10-100 RPS. For high-traffic apps, look for plans with higher limits or dedicated nodes.
- Archive data: If your dApp needs historical state (e.g., querying balances at past blocks), ensure the provider offers archive node access.
- WebSocket: For real-time features, verify WSS support and subscription method availability.
- Geographic coverage: Providers with multiple regions reduce latency for global users.
OnFinality offers both shared RPC endpoints and dedicated nodes for Ethereum, with support for archive data and WebSocket. Check our supported networks and pricing for details.
Common pitfalls and troubleshooting
- Rate limiting: If you receive HTTP 429 or "rate limit exceeded" errors, reduce request frequency or upgrade your plan.
- Incorrect chain ID: Using the wrong chain ID (e.g., 5 for Goerli instead of 1) will cause transaction failures.
- Missing archive data:
eth_callwith a past block number may fail if the provider doesn't serve archive state. - WebSocket disconnects: Implement reconnection logic with exponential backoff.
- JSON-RPC errors: Check the
errorfield in responses; common codes include -32000 (server error) and -32602 (invalid params).
Key Takeaways
- ETH RPC endpoints provide standardized access to the Ethereum blockchain via JSON-RPC.
- Choose a provider based on rate limits, archive support, WebSocket availability, and geographic distribution.
- For production apps, consider dedicated nodes for consistent performance and reliability.
- Always verify chain settings (chain ID, RPC URL) to avoid network mismatches.
- Implement error handling and retry logic to handle transient failures.
Frequently Asked Questions
What is the difference between HTTP and WebSocket RPC endpoints? HTTP endpoints are request-response based, suitable for one-off queries. WebSocket endpoints maintain a persistent connection, enabling real-time subscriptions (e.g., new blocks, pending transactions).
Can I use a free ETH RPC endpoint in production? Free endpoints are fine for prototyping and low-volume apps, but they often have strict rate limits and no SLA. For production, consider a paid plan or dedicated node.
How do I find my ETH RPC endpoint URL?
Sign up with an RPC provider like OnFinality, create an API key, and use the provided endpoint (e.g., https://eth-mainnet.onfinality.io/api/v1/YOUR-KEY).
What is an archive node? An archive node stores the entire Ethereum state history, allowing queries at any past block. Full nodes only keep recent state. Archive access is needed for historical data analysis.
How do I add Ethereum mainnet to MetaMask? Open MetaMask, click the network dropdown, select "Add Network", and enter the chain details (RPC URL, Chain ID: 1, Currency: ETH). You can also use ChainList for automatic addition.