Summary
An ETH RPC node is a server that exposes Ethereum's JSON-RPC API, allowing applications to read blockchain data and submit transactions. This article explains what an ETH RPC node is, how to connect to Ethereum using public or dedicated endpoints, and how to choose the right infrastructure for your project.
Quick Answer: What Is an ETH RPC Node?
An ETH RPC node is a server that runs Ethereum client software and exposes the Ethereum JSON-RPC API. Applications use this API to read blockchain data (balances, transaction receipts, contract state) and to broadcast signed transactions. The term "RPC" stands for Remote Procedure Call, and in Ethereum's case it refers to the standard JSON-RPC interface that wallets, explorers, and dApps use to interact with the network.
When you connect to an ETH RPC node, you are essentially sending HTTP or WebSocket requests to that node's endpoint. The node processes the request against its local copy of the blockchain and returns the result. This is the foundation of almost every Web3 application, from a simple balance checker to a complex DeFi protocol.
Decision Guide: Public vs. Dedicated ETH RPC Node
Before you write any code, you need to decide which type of ETH RPC node to use. The right choice depends on your workload, reliability needs, and budget. Here is a quick framework to help you decide:
- Prototyping and small projects: A public RPC endpoint is fine. You can use the official OnFinality public endpoint for Ethereum Mainnet:
https://eth.api.onfinality.io/public. It is free and requires no API key, but it is rate-limited and shared with other users. - Production applications with moderate traffic: A shared RPC service with a paid plan is a good middle ground. You get higher rate limits and better reliability than public endpoints, but you still share infrastructure with other customers.
- High-throughput or latency-sensitive applications: A dedicated node is the best option. You get a private instance with dedicated resources, which means consistent performance and no noisy neighbors. This is critical for trading bots, indexers, and other applications that cannot tolerate rate limiting or downtime.
If you are unsure, start with a public endpoint for development, then move to a paid plan or dedicated node as your traffic grows. OnFinality offers both shared and dedicated options, and you can compare plans on the RPC pricing page.
How an ETH RPC Node Works
An ETH RPC node is essentially a full node that exposes a JSON-RPC interface. The node maintains a copy of the Ethereum blockchain, validates new blocks, and executes transactions. When you send a request like eth_blockNumber, the node returns the latest block number it has synced. When you send eth_sendRawTransaction, the node validates the transaction and broadcasts it to the network.
There are two main types of Ethereum clients: execution clients (like Geth and Nethermind) and consensus clients (like Prysm and Lighthouse). An RPC node typically runs both, but the JSON-RPC API is primarily exposed by the execution client. The consensus client handles proof-of-stake and block finality.
For most developers, you do not need to run your own node. Instead, you use an RPC provider that manages the infrastructure for you. This saves you time and money, and it gives you access to additional features like archive data and trace methods.
Connecting to Ethereum: Endpoint and Chain Settings
To connect your application to Ethereum, you need the correct endpoint and chain settings. Here are the key details for Ethereum Mainnet:
| Setting | Value |
|---|---|
| Chain ID | 1 |
| Network Name | Ethereum Mainnet |
| Native Currency | ETH (18 decimals) |
| Public RPC URL | https://eth.api.onfinality.io/public |
| WebSocket URL | wss://eth.api.onfinality.io/public/ws (if available) |
| Explorer | https://etherscan.io |
If you are using a wallet like MetaMask, you can add Ethereum Mainnet as a custom network using these settings. For developers, you will use these values in your Web3 library configuration.
Example: Making Your First JSON-RPC Call
Here is a simple curl command to call the eth_blockNumber method on the public OnFinality endpoint:
curl -X POST https://eth.api.onfinality.io/public \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
The response will look something like this:
{"jsonrpc":"2.0","result":"0x134c2b4","id":1}
The result is a hexadecimal string representing the latest block number. You can convert it to decimal to get the human-readable block number.
Using ethers.js to Interact with an ETH RPC Node
Most developers use a JavaScript library like ethers.js or viem to interact with Ethereum. Here is an example using ethers.js:
const { ethers } = require("ethers");
const provider = new ethers.JsonRpcProvider("https://eth.api.onfinality.io/public");
async function getBlockNumber() {
const blockNumber = await provider.getBlockNumber();
console.log("Latest block:", blockNumber);
}
getBlockNumber();
This code creates a provider that connects to the public endpoint and fetches the latest block number. You can replace the URL with your own dedicated endpoint if you have one.
Common Methods and Their Use Cases
Here are some of the most common JSON-RPC methods you will use with an ETH RPC node:
| Method | Description |
|---|---|
eth_blockNumber | Get the latest block number |
eth_getBalance | Get the balance of an address |
eth_call | Execute a read-only contract call |
eth_sendRawTransaction | Broadcast a signed transaction |
eth_getTransactionReceipt | Get the receipt of a transaction |
eth_getLogs | Get logs matching a filter |
eth_subscribe | Subscribe to new blocks or logs (WebSocket only) |
For a full list of methods, refer to the Ethereum JSON-RPC specification. Most RPC providers support the standard methods, but some may have additional methods or limitations.
Choosing the Right ETH RPC Node Provider
When you decide to use a managed RPC provider, you need to evaluate several factors. Here is a comparison table to help you assess providers:
| Provider | Shared/Dedicated | Archive Data | Trace Methods | WebSocket Support |
|---|---|---|---|---|
| OnFinality | Both | Yes | Yes | Yes |
| Provider A | Both | Yes | Yes | Yes |
| Provider B | Shared only | No | No | Yes |
OnFinality offers both shared and dedicated nodes, with support for archive data, trace methods, and WebSocket connections. You can check the supported RPC networks page to see which features are available for Ethereum.
When comparing providers, consider the following:
- Rate limits: What are the limits for your plan? Are they sufficient for your traffic?
- Data availability: Do you need archive data or trace methods? Not all providers offer them.
- Latency: Where are the nodes located? Geographic proximity can reduce latency.
- Reliability: What is the uptime history? Look for providers with transparent status pages.
- Pricing: Compare costs for your expected usage. Dedicated nodes are more expensive but offer better performance.
Troubleshooting Common Issues
Even with a reliable RPC provider, you may encounter issues. Here are some common problems and how to fix them:
- Rate limiting: If you receive HTTP 429 errors, you are hitting the rate limit. Consider upgrading your plan or using a dedicated node.
- Timeout: If requests time out, check your network connection and the provider's status page. You may also need to increase your client's timeout settings.
- Incorrect chain ID: If you are sending transactions to the wrong network, you will get errors. Always verify your chain ID (1 for Ethereum Mainnet).
- Nonce errors: If you get "nonce too low" or "nonce too high" errors, your transaction nonce is incorrect. Use
eth_getTransactionCountto get the correct nonce. - WebSocket disconnects: If your WebSocket connection drops, implement reconnection logic in your application.
Key Takeaways
- An ETH RPC node is the gateway to Ethereum, providing the JSON-RPC API for reading and writing blockchain data.
- Public endpoints are great for development, but production apps should use a managed service or dedicated node for reliability.
- OnFinality offers public, shared, and dedicated ETH RPC nodes, with support for archive data and WebSocket.
- Always verify your chain settings and use the correct endpoint for your network.
- Monitor your usage and choose a plan that matches your traffic to avoid rate limiting.
Frequently Asked Questions
What is the difference between an ETH RPC node and a full node?
An ETH RPC node is a full node that exposes the JSON-RPC API. All RPC nodes are full nodes, but not all full nodes are configured to serve RPC requests. Running a full node gives you direct access to the network, but it requires significant hardware and maintenance.
Do I need to run my own ETH RPC node?
No. For most applications, using a managed RPC provider is more cost-effective and reliable. You avoid the overhead of syncing, upgrading, and monitoring your own node. OnFinality provides managed nodes for Ethereum and many other networks.
Can I use a public ETH RPC node for production?
Public endpoints are not recommended for production because they are rate-limited and shared. They can go down or become slow under heavy load. For production, use a paid plan or a dedicated node.
What is the best ETH RPC node provider?
The best provider depends on your needs. Evaluate factors like reliability, data support, and pricing. OnFinality is a strong option, offering both shared and dedicated nodes with transparent pricing. Check the RPC pricing page for details.
How do I get an ETH RPC node API key?
With OnFinality, you can sign up for an account and create an API key from the dashboard. The API key is used to authenticate requests to your dedicated or shared endpoint. Public endpoints do not require a key.
What is the Ethereum Sepolia testnet RPC endpoint?
For Sepolia, the public endpoint is https://eth-sepolia.api.onfinality.io/public. You can use this for testing on the Sepolia testnet. More details are on the Sepolia network page.