What is an RPC node, and how does it work?

GoldRush TeamUpdated 19 min read

An RPC node is a blockchain node that answers JSON-RPC requests from wallets and apps. How a request moves through one, full vs archive nodes, and hosting.

An RPC node is a blockchain node that answers remote procedure calls from software outside the network. A wallet or app sends it a JSON-RPC request such as "what is this address's balance?" or "broadcast this signed transaction", and the node answers from its own verified copy of the chain or passes the transaction to its peers. Every Ethereum node can be an RPC node: "RPC node" describes the job of serving those requests, not a separate kind of node. The URL you send requests to is the RPC endpoint.

This guide explains what happens inside a node when a request arrives, how to read blocks and transactions with JSON-RPC, the difference between full and archive nodes, how hosted RPC providers scale, and when an indexed API is a better tool than raw RPC. Examples use Ethereum, whose node interface is standardised; other chains follow the same pattern with their own methods.

What an RPC node does

A blockchain node runs client software that connects to peers, downloads blocks, checks them against the protocol rules and keeps the resulting state: every account's balance, every contract's code and storage. That is enough to keep the network honest, but not to let anyone build on it. An app also needs a way in.

That way in is an API the client exposes, usually JSON-RPC 2.0: a request names a method, passes params and carries an id, and the response returns the same id with a result or an error. On Ethereum, every execution client implements the same Ethereum JSON-RPC API, specified in the execution-apis repository (rendered reference), so eth_getBalance behaves the same whether the node runs Geth, Nethermind, Besu, Erigon or Reth.

An RPC node handles two kinds of work:

  • Reads: the latest block, a balance, a transaction receipt, contract storage, event logs, or the result of calling a contract function without sending a transaction (eth_call). The node answers from its own database.
  • Writes: a signed transaction submitted with eth_sendRawTransaction. The node checks it, adds it to its transaction pool and gossips it to its peers, so that a block proposer can include it. The node never holds your keys: you sign first, then submit.

For the protocol itself, request format, batching and error codes, and how JSON-RPC compares with gRPC, see JSON-RPC vs gRPC: understanding RPC protocols in blockchain.

How an RPC call works, step by step

Here is a real exchange. These two calls went to a free public Ethereum endpoint, https://ethereum-rpc.publicnode.com, on 20 November 2026.

To follow along you need curl for the raw calls and Node.js 18 or later for the JavaScript. The scripts use top-level await, so save each one as a .mjs file (rpc.mjs, read.mjs, balances.mjs) and run it with node <file>. The GoldRush examples read your API key from the GOLDRUSH_API_KEY environment variable.

curl https://ethereum-rpc.publicnode.com \  -H "Content-Type: application/json" \  -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' # {"jsonrpc":"2.0","result":"0x193ac39","id":1} curl https://ethereum-rpc.publicnode.com \  -H "Content-Type: application/json" \  -d '{"jsonrpc":"2.0","id":2,"method":"eth_getBalance","params":["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","latest"]}' # {"jsonrpc":"2.0","id":2,"result":"0x507a1459b4ff4f9c"}

0x193ac39 is block 26,455,097. 0x507a1459b4ff4f9c is the address's balance in wei (10^-18 ETH): 5,798,969,845,714,210,716 wei, about 5.799 ETH. Ethereum's JSON-RPC encodes every number as a 0x-prefixed hex string, and the second parameter of eth_getBalance picks the block: a number, or a tag such as latest, safe or finalized.

Between the request and the response, the node did this:

  1. Received it. The client's HTTP server accepted a POST on its RPC port.
  2. Decoded it. It parsed the JSON, checked it is a valid JSON-RPC 2.0 request (or a batch of them), and pulled out the method, parameters and id. Malformed JSON gets error -32700; an unknown method gets -32601.
  3. Dispatched it. It looked the method up in its registry. Methods are grouped by namespace (eth_, net_, web3_, debug_, txpool_, admin_), and the operator chooses which namespaces each transport exposes.
  4. Executed it. For eth_getBalance it read the account from its state database at the requested block. For eth_call it would run the contract's code in the EVM against that state and discard the changes; for eth_sendRawTransaction, validate the transaction, add it to the pool and gossip it.
  5. Encoded and returned the result. It turned the value into hex, wrapped it in a response with the same id, and wrote it back on the same connection.

Errors come back the same way. Asking the same endpoint for a method that doesn't exist returned:

{ "jsonrpc": "2.0", "id": 4, "error": { "code": -32601, "message": "Method not found" } }

The same call in JavaScript, with no library. It also reads an ERC-20 balance, which takes more than one call, because a token balance lives in the token's contract rather than on the account. Save it as rpc.mjs:

const RPC_URL = process.env.RPC_URL ?? "https://ethereum-rpc.publicnode.com"; let nextId = 1;async function rpc(method, params = []) {    const res = await fetch(RPC_URL, {        method: "POST",        headers: { "Content-Type": "application/json" },        body: JSON.stringify({ jsonrpc: "2.0", id: nextId++, method, params }),    });    const { result, error } = await res.json();    if (error) throw new Error(`${method}: ${error.code} ${error.message}`);    return result;} const wallet = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";const USDC = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"; // Numbers come back as 0x-prefixed hex strings.const block = BigInt(await rpc("eth_blockNumber"));const wei = BigInt(await rpc("eth_getBalance", [wallet, "latest"]));console.log("block", block.toString(), "balance", Number(wei) / 1e18, "ETH"); // An ERC-20 balance is a contract call: balanceOf(address) is selector 0x70a08231// followed by the address left-padded to 32 bytes. decimals() is 0x313ce567.const data = "0x70a08231" + wallet.slice(2).toLowerCase().padStart(64, "0");const raw = BigInt(await rpc("eth_call", [{ to: USDC, data }, "latest"]));const decimals = Number(BigInt(await rpc("eth_call", [{ to: USDC, data: "0x313ce567" }, "latest"])));console.log("USDC", Number(raw) / 10 ** decimals); // block 26455106 balance 5.798969845714211 ETH// USDC 39.192124

Run it with node rpc.mjs. In an app you would normally use a library such as viem, ethers or web3.py, which wrap these methods in typed functions; the requests on the wire are the same.

Reading blocks and transactions

Most reads go beyond balances to blocks and transactions. Three methods cover them:

  • eth_getBlockByNumber takes a block number (hex) or a tag such as latest, and a full-transactions flag: false returns the block's header fields and a list of transaction hashes; true returns every transaction as a full object, which makes the response much larger.
  • eth_getTransactionByHash returns the transaction as it was sent: sender, recipient, value, input data, gas limit and nonce.
  • eth_getTransactionReceipt returns what happened when it ran: status (0x1 success, 0x0 reverted), the gas used, the effective gas price and the event logs it emitted. A transaction still in the mempool has no receipt yet; the method returns null.

This script, read.mjs, sends them to the GoldRush JSON-RPC endpoint for Ethereum, with the API key in an Authorization: Bearer header (authentication). The request bodies are standard, so setting RPC_URL to any other Ethereum endpoint works too:

// GoldRush JSON-RPC for Ethereum; any Ethereum endpoint answers the same requests.const RPC_URL = process.env.RPC_URL ?? "https://rpc.goldrushdata.com/v1/eth-mainnet";if (RPC_URL.includes("goldrushdata.com") && !process.env.GOLDRUSH_API_KEY) {    throw new Error("Set GOLDRUSH_API_KEY, or set RPC_URL to another Ethereum endpoint");} let nextId = 1;async function rpc(method, params = []) {    const res = await fetch(RPC_URL, {        method: "POST",        headers: {            "Content-Type": "application/json",            Authorization: `Bearer ${process.env.GOLDRUSH_API_KEY}`,        },        body: JSON.stringify({ jsonrpc: "2.0", id: nextId++, method, params }),    });    const { result, error } = await res.json();    if (error) throw new Error(`${method}: ${error.code} ${error.message}`);    return result;} // Block 26,455,097. The second parameter is the full-transactions flag:// false returns transaction hashes only, true returns full transaction objects.const block = await rpc("eth_getBlockByNumber", ["0x193ac39", false]);console.log("block", Number(block.number), new Date(Number(block.timestamp) * 1000).toISOString());console.log("transactions", block.transactions.length, "gas used", Number(block.gasUsed)); // The transaction as it was sent, then the receipt: what happened when it ran.const hash = block.transactions[0];const tx = await rpc("eth_getTransactionByHash", [hash]);const receipt = await rpc("eth_getTransactionReceipt", [hash]);console.log("tx", hash);console.log("from", tx.from, "to", tx.to, "value", Number(BigInt(tx.value)) / 1e18, "ETH");console.log(    "status",    receipt.status === "0x1" ? "success" : "reverted",    "gas used",    Number(receipt.gasUsed),    "logs",    receipt.logs.length); // block 26455097 2026-11-20T08:25:11.000Z// transactions 382 gas used 49001569// tx 0xba280178b1c6f05918b0442bc702235b83bd7da17a3e9d9d1c04483f97ddb30e// from 0x2252f216f4a494a87025123425181ca1bb754fb8 to 0x0000000aa232009084bd71a5797d089aa4edfad4 value 0 ETH// status success gas used 157579 logs 5

Every number in these responses is hex-encoded, as with eth_getBalance: the block's number, timestamp (Unix seconds) and gasUsed, the transaction's value (wei) and nonce, and the receipt's status and gasUsed. Part of that receipt, as the node returned it:

{    "transactionHash": "0xba280178b1c6f05918b0442bc702235b83bd7da17a3e9d9d1c04483f97ddb30e",    "blockNumber": "0x193ac39",    "transactionIndex": "0x0",    "status": "0x1",    "gasUsed": "0x2678b",    "effectiveGasPrice": "0x7a942f5",    "logs": ["... 5 log objects with raw topics and data ..."]}

If the key is missing or malformed, GoldRush answers with a standard JSON-RPC error object. Sent with no key, or a made-up one, on 22 November 2026, the endpoint returned HTTP 200 and this body:

{    "jsonrpc": "2.0",    "error": {        "code": -32600,        "message": "missing or malformed api key",        "data": null    }}

read.mjs throws it as eth_getBlockByNumber: -32600 missing or malformed api key. Check that GOLDRUSH_API_KEY is set in the shell that runs the script. The authentication docs describe this case as HTTP 401 with code -32001 ("missing or invalid Authorization header"), so check the body's error field, as the script does, rather than the HTTP status. The same page lists the other codes: -32002 (HTTP 403, the key has no JSON-RPC access), -32003 (HTTP 402, not enough credits) and -32005 (HTTP 429, rate limited; retry after Retry-After).

The logs are raw: topics and data as hex, with no event names and no token amounts in human units. To get one transaction with its logs decoded and its value and gas quoted in USD, the Foundational API's transaction API answers in one call (credit cost: 0.1 per call).

Inside an RPC node: execution and consensus clients

Since Ethereum moved to proof of stake, a node is two programs working together:

  • The execution client (Geth, Nethermind, Besu, Erigon, Reth and others) executes transactions in the EVM, holds the state and the transaction pool, and gossips transactions with other execution clients. It serves the JSON-RPC API that wallets and apps use. This is the part people mean by "RPC node".
  • The consensus client (Lighthouse, Lodestar, Nimbus, Prysm, Teku, Grandine) runs proof-of-stake consensus: it receives blocks and attestations from its own peers, runs fork choice and tracks the head of the chain. It serves a separate HTTP API, the Beacon API, for consensus data such as validator status.

The two talk over the Engine API, an authenticated local RPC connection. Geth's docs show it on port 8551, secured with a shared JWT secret file that both clients load (connecting to consensus clients). The consensus client tells the execution client which block is the new head; the execution client executes it and reports whether it is valid. Without a synced consensus client, an execution client can't follow the chain, so it can't give current answers.

Inside the execution client, a JSON-RPC request passes through these layers, which map onto the "client handler, decoder, router, core engine, encoder" model in older explanations:

Layer What it does In Geth, for example
Transport Accepts connections and frames requests HTTP on port 8545, WebSocket on 8546, and an IPC socket; HTTP and WebSocket are opt-in
Codec Parses JSON, validates JSON-RPC 2.0, handles batches, serialises responses and errors One codec shared by every transport
Dispatch Maps a method name to a handler, and refuses namespaces the operator hasn't enabled --http.api eth,net,web3 is the default allowlist; debug and admin must be enabled explicitly
Backend Reads state, blocks, receipts and logs from the database, or runs the EVM for eth_call and gas estimates The state database plus the EVM
Transaction pool and P2P Validates submitted transactions, keeps them pending and gossips them to peers The txpool and the devp2p network on port 30303

WebSocket matters because it lets the node push data: eth_subscribe streams new block headers, logs or pending transactions over an open connection instead of making the client poll. IPC is a local socket for programs on the same machine.

Full, archive and light nodes

What a node can answer depends on what it keeps. ethereum.org describes three types:

Type What it stores What it can answer over RPC
Full Verifies every block but keeps state only for recent blocks (typically the latest 128), pruning older state Current state, recent history, blocks, receipts and logs; state at an old block only by re-executing to rebuild it, which is slow
Archive Everything a full node keeps, plus the state after every block since genesis State at any block quickly: "what was this balance at block 4,000,000?"; the backend for explorers and analytics
Light Block headers only, requesting other data from full nodes and checking it against the headers Little on its own; light clients are still under development on Ethereum

The difference shows up as soon as you ask about the past. The same public endpoint that answered for latest refused the same balance at block 1:

{    "jsonrpc": "2.0",    "id": 3,    "error": {        "code": -32602,        "message": "Archive requests require a personal token. Get one at: https://www.allnodes.com/publicnode"    }}

That wording is the provider's, but the reason is general: answering for an old block needs archive state, which is expensive to store. ethereum.org's archive node page puts a mainnet archive at roughly 2-3 TB for Erigon, Reth and Geth's path-based archive, and 12 TB or more for Besu and Nethermind, and an initial archive sync on a consumer machine at up to a month. Tracing methods (debug_traceTransaction, trace_*) have similar needs, which is why providers often bill them separately.

Public, private and hosted RPC endpoints

You reach an RPC node through an endpoint URL. In practice there are three kinds:

  • Public endpoints: free URLs such as the one above, or a chain's own public RPC. Good for trying things and light use. They are rate limited, often restrict archive and trace methods, and give no service guarantees.
  • Your own node: http://localhost:8545 on a machine you run. Nothing is rate limited but your hardware, and no third party sees which addresses you query.
  • Hosted providers: a URL with an API key from a node provider, backed by fleets of nodes. Keys go in the URL path or, better, an Authorization header so they don't end up in logs.

GoldRush is one of the hosted options. GoldRush JSON-RPC serves standard Ethereum-style methods on EVM chains, including archive depth and the debug_* and trace_* namespaces, and the Solana method set with WebSocket subscriptions. It authenticates with an Authorization: Bearer header and uses the same API key as the other GoldRush APIs. The Ethereum RPC endpoint page has the URL and code for Ethereum.

How RPC providers scale: load balancing, caching and failover

One node can serve a limited number of requests per second, and a slow eth_getLogs over a wide block range can stall it. Providers put several layers in front of their nodes:

  • Load balancing. Requests spread across many nodes per chain. Because nodes can be a block or two apart, a naive balancer can return block N from one node and then "unknown block" from the next. Providers handle this by routing by block height or keeping a client on one node for a while.
  • Method-aware routing. Cheap reads go to full nodes; calls for old state and traces go to archive nodes; eth_sendRawTransaction goes to nodes well connected to peers.
  • Caching. Data for a finalized block never changes, so a block, receipt or eth_call result at a fixed old block number can be cached indefinitely. Answers for latest or pending change every block and can only be cached briefly.
  • Rate limits and quotas per API key, often priced per method weight rather than per request.
  • Failover. Unhealthy nodes, or whole upstream providers, are taken out of rotation. GoldRush JSON-RPC, for example, is a router in front of several independent upstream providers: it scores each one per chain and method on success rate, latency and cost, sends each call to the best one, and demotes failing providers automatically.

The same patterns apply if you run your own fleet: a reverse proxy in front of two or more nodes, health checks on sync status, and a cache for finalized data.

Running your own RPC node vs using a provider

Your own node Hosted provider
Setup Execution client plus consensus client, a fast SSD, and a sync measured in hours to days (weeks for an archive) Sign up, get a key, start calling
Cost Hardware or cloud instances, bandwidth and someone's time to upgrade clients before network forks Free tiers, then usage-based plans
Limits Your hardware's capacity Rate limits and method pricing
Archive / trace You choose the client and mode, and pay in disk Usually available, often at a higher price
Privacy and trust You verify the data yourself; nobody else sees your queries The provider sees your requests and you trust its answers
Reliability Up to you: redundancy needs more than one node Many nodes and failover, under the provider's SLA
Multiple chains One stack per chain Usually one key for many chains

Run your own node when you need verified data without trusting a third party, very high or unusual call volumes, client flags providers don't expose, or privacy for the addresses you query. ethereum.org's run a node guide covers hardware and setup. Use a provider when you need many chains, archive or trace access without the disks, or don't want to operate infrastructure; nodes as a service describes the trade-off. Many teams do both: their own node for the critical path, a provider as fallback.

Securing an RPC node

If you run one, the client docs are blunt: Geth's security page says its RPC endpoints are not designed to withstand hostile clients or heavy traffic, and recommends against exposing them to the internet.

  • Bind to localhost and firewall the RPC port. Geth listens on 127.0.0.1:8545 by default; block that port to everything except trusted machines, and leave only the P2P port (30303 TCP and UDP) open.
  • Put a proxy in front for anything public: TLS termination, authentication, rate limiting, request size limits, logging and monitoring.
  • Expose only the namespaces you need. Keep eth, net and web3; never expose admin, debug or account-management methods to untrusted clients. By default Geth refuses to unlock accounts while HTTP or WebSocket is enabled, because bots scan for open nodes.
  • Keep keys off the node. Sign elsewhere, with a hardware wallet or a separate signer such as Clef, and submit signed transactions.
  • Protect the Engine API. Keep port 8551 local and its JWT secret private.
  • Restrict browser access with --http.corsdomain and --ws.origins rather than *.

As a client of a provider, keep API keys server-side or restrict them by origin, prefer header authentication over keys in URLs, and don't trust a single endpoint for high-value decisions: compare against a second source.

When to use an indexed API instead of raw RPC

JSON-RPC answers questions about one block, one account or one transaction at a time. It has no method for "every token this wallet holds", "this address's transaction history" or "what is this worth in dollars". You can build those answers from RPC, but it takes work:

  • Token balances. As the code above shows, each ERC-20 balance is an eth_call to that token's contract, and you must already know which contracts to ask. Discovering them means scanning Transfer logs for the address across the chain's history with eth_getLogs, which providers limit by block range.
  • History. There is no "transactions by address" method. You scan every block, or index logs yourself into a database.
  • Prices and metadata. Token names, decimals, logos and USD values are not part of the chain's state; you fetch and maintain them separately.
  • Many chains. Each chain is another endpoint, often with different methods and quirks.

That is what indexed APIs are for: someone runs the nodes and the indexing, and you get the decoded answer in one request. With the token balance API from the GoldRush Foundational API, one call returns every token a wallet holds on a chain, native token included, with decimals, symbols and a USD quote (credit cost: 1 per call). Save it as balances.mjs:

if (!process.env.GOLDRUSH_API_KEY) throw new Error("Set GOLDRUSH_API_KEY to your GoldRush API key");const API = "https://api.covalenthq.com/v1";const headers = { Authorization: `Bearer ${process.env.GOLDRUSH_API_KEY}` }; // Every token a wallet holds on one chain, native token included, with a USD value.async function tokenBalances(chain, wallet) {    const url = `${API}/${chain}/address/${wallet}/balances_v2/?quote-currency=USD&no-spam=true`;    const res = await fetch(url, { headers });    const body = await res.json();    if (!res.ok || body.error) throw new Error(`${res.status} ${body.error_message ?? ""}`);    const { data } = body;    return data.items        .filter((t) => t.balance !== "0")        .map((t) => ({            symbol: t.contract_ticker_symbol,            token: t.contract_address,            // balance is a string in the token's smallest unit; Number() is fine for display.            amount: Number(t.balance) / 10 ** (t.contract_decimals ?? 0),            usd: t.quote,        }));} for (const chain of ["eth-mainnet", "base-mainnet"]) {    console.table(await tokenBalances(chain, "vitalik.eth"));}

When a request fails, the Foundational API answers with the same envelope as a success, with data set to null and error_code equal to the HTTP status. The error handling docs show this body for a chain that doesn't support a requested flag:

{    "data": null,    "error": true,    "error_message": "This chain does not currently support flag: with-state.",    "error_code": 501}

balances.mjs throws it with the status and error_message. A 501 means the chain or endpoint doesn't support what you asked for, so change the request rather than retrying. One exception: a request sent with no Authorization header at all is rejected before it reaches the API, with an HTML 401 page instead of JSON, so res.json() fails; the key check at the top of the script avoids that case.

The wallet can be an address or a name such as an ENS name, which the API resolves. no-spam=true drops suspected spam tokens on Foundational Chains. For several chains in one request, the wallet balance API returns balances across EVM chains for one address; for history, paginated transactions returns an address's decoded transactions.

A rule of thumb: use raw RPC to submit transactions, read live contract state, simulate calls and follow new blocks; use an indexed API for portfolio views, histories, prices and anything across many tokens or chains. The two use the same GoldRush API key, so one app can do both.

Frequently asked questions

How do I read blockchain data with JSON-RPC?

Send an HTTP POST with a JSON-RPC 2.0 body to a node's endpoint: eth_blockNumber for the latest block, eth_getBlockByNumber for a block (with false for transaction hashes or true for full transactions), eth_getTransactionByHash and eth_getTransactionReceipt for a transaction and its outcome, eth_getBalance and eth_call for state. Numbers come back as hex strings, and log data comes back undecoded.

What is an RPC node in simple terms?

An RPC node is a blockchain node that accepts requests from outside the network and answers them. Wallets and apps send it JSON-RPC calls to read data, such as a balance or the latest block, or to submit signed transactions, and it responds from its own verified copy of the chain.

What is the difference between an RPC node and an RPC endpoint?

The node is the server running the blockchain client. The endpoint is the URL you send requests to, such as http://localhost:8545 for your own node or a provider's URL with an API key. A provider's endpoint usually sits in front of many nodes, with a load balancer choosing which one answers each request.

Is an RPC node the same as a full node?

Not exactly. A full node verifies every block and keeps recent state; it becomes an RPC node when it exposes an RPC interface for clients. Most RPC nodes are full nodes, and those that answer questions about old blocks are archive nodes, which keep the state after every block.

Do I need an archive node?

Only if you query state at old blocks, such as a balance at a past block or contract storage from last year, or run traces over history. Sending transactions and reading current state work on a full node. Archive state takes terabytes of disk, so most teams use a provider for archive calls.

Should I run my own RPC node or use a provider?

Run your own if you need to verify data yourself, keep queries private, or make very high volumes of calls. Use a provider if you need many chains, archive or trace access, or don't want to operate and upgrade nodes. Many production apps use their own node and keep a provider as a fallback.

Is GoldRush an RPC provider?

GoldRush offers JSON-RPC endpoints for EVM chains and Solana, routed across several upstream providers, with archive, debug and trace methods. It also offers indexed REST APIs, such as token balances and transaction histories, that return decoded data in one call. Both use the same API key.

Next steps

Get new guides by email

New tutorials and best practices for building with blockchain data, sent as they're published.