Nadcab logo

X Layer RPC Guide: Archive, Debug, Trace, and Scale

Published on: 26 Oct 2026

Ai Overview

Choosing an X Layer RPC endpoint sounds simple until your app needs more than basic balance checks and transaction sends. Nadcab Cloud starts at $10 with no rate tiers: you pay $0. With Nadcab RPC, pricing is usage-based at $0. 375 per 1M compute units, and Nadcab Cloud starts from $10 with no rate tiers.

Key Takeaways

  • Use a full node X Layer RPC for current-state reads, wallet flows, and recent receipts, but not for guaranteed historical state queries.
  • Archive access matters when your application must read contract storage exactly as it existed at older block heights.
  • Debug and trace APIs are essential for internal call analysis, failed transaction diagnosis, and high-quality indexing.
  • Production X Layer architectures should separate frontend, transaction, and indexing traffic so heavy jobs do not impact user flows.
  • Nadcab RPC gives X Layer access at https://rpc.nadcab.com/xlayer/<your-api-key> with one API key, HTTPS and WebSocket support, and multiple scaling models.

Choosing an X Layer RPC endpoint sounds simple until your app needs more than basic balance checks and transaction sends. Wallets, trading interfaces, backends, and indexers all hit different limits. Some need only the latest chain state. Others need historical storage reads, internal call traces, or enough headroom to survive traffic spikes without dropping user requests.

That is why the real question is not just “which endpoint do I use?” but “which RPC capabilities match my workload?” On X Layer, the difference between a full node, archive access, and trace-capable infrastructure can decide whether your product ships quickly or gets stuck rebuilding missing data off-chain.

This guide breaks down the practical choices. You will see which JSON-RPC methods most apps use, when a full node RPC is enough, when archive data matters, how debug and trace APIs help during incidents, and how to scale from a prototype to production with Nadcab RPC if you want a managed gateway for X Layer and other supported networks.

One API key. 70+ blockchains. Production-grade RPC.

Nadcab RPC gives you HTTPS and WebSocket endpoints across 150+ chain endpoints with smart routing and a 99.99% gateway uptime target. Pay as you go from $0.375 per 1M compute units.

Get Your Free API Key →Browse Supported Chains

What X Layer RPC is and who needs it

X Layer RPC is the JSON-RPC interface your application uses to read chain state and send transactions on X Layer. In practice, it sits between your app and one or more X Layer nodes. Every wallet refresh, contract read, gas estimate, event query, and raw transaction broadcast flows through that layer.

Different teams use RPC differently:

  • Wallets need fast reads, nonce management, gas estimation, and reliable transaction propagation.
  • dApp frontends need responsive contract calls and log queries without exposing users to flaky infrastructure.
  • Backends need predictable throughput, retries, and good error handling.
  • Indexers and analytics pipelines often need historical state, large block-range log scans, and traces.
  • Ops teams need status visibility, failover, and ways to investigate incidents.

If your app is multi-chain, the infrastructure problem gets harder. Using a gateway with one API key and a consistent endpoint pattern can reduce setup overhead. Nadcab RPC supports X Layer with the endpoint format https://rpc.nadcab.com/xlayer/<your-api-key>, alongside many other supported networks listed on the chainlist and endpoints page.

Core X Layer JSON-RPC methods most apps use

Most applications start with a small subset of methods. The challenge is less about knowing the method names and more about understanding their performance and data implications.

Read methods used by almost every app

  • eth_blockNumber for the latest block height.
  • eth_chainId to confirm the client is connected to X Layer.
  • eth_getBalance for native token balances.
  • eth_call for contract reads.
  • eth_getCode to check whether an address is a contract.
  • eth_getTransactionCount for wallet nonce handling.
  • eth_gasPrice and eth_estimateGas for transaction preparation.
  • eth_getLogs for event indexing and UI updates.

Write and lifecycle methods

  • eth_sendRawTransaction to broadcast a signed transaction.
  • eth_getTransactionReceipt to confirm inclusion and parse emitted logs.
  • eth_getTransactionByHash for transaction status polling.

For a simple dApp, that set is often enough. Problems start when you need old state at a specific block, internal calls inside a transaction, or heavy log scans over large ranges.

Minimal raw request example

curl https://rpc.nadcab.com/xlayer/<your-api-key> 
  -H "Content-Type: application/json" 
  -d '{
    "jsonrpc":"2.0",
    "id":1,
    "method":"eth_blockNumber",
    "params":[]
  }'

That single endpoint pattern is easy to automate across environments. You can review authentication and setup details in the Nadcab RPC developer docs.

When a full node RPC is enough on X Layer

A full node is enough when your app mostly needs current state and recent history. This is common for consumer-facing products where users care about what is happening now, not what storage looked like months ago.

Use a full node if your workload looks like this

  • Reading current balances and allowances.
  • Calling contracts against the latest block.
  • Sending swaps, transfers, or bridge transactions.
  • Watching recent events for UI updates.
  • Fetching receipts for transactions your app submitted.

In these cases, the main operational concerns are uptime, routing, retries, and latency consistency. You do not usually need a separate archive backend. Shared infrastructure such as Nadcab Cloud can be enough if your request patterns are typical and you want auto-scaling without running nodes yourself.

Example with ethers.js

import { ethers } from "ethers";

const provider = new ethers.JsonRpcProvider(
  "https://rpc.nadcab.com/xlayer/<your-api-key>"
);

const blockNumber = await provider.getBlockNumber();
const balance = await provider.getBalance("0x0000000000000000000000000000000000000000");

console.log({ blockNumber, balance: balance.toString() });

A full node choice is usually correct when your app can tolerate querying only recent state and does not rely on replaying historical contract storage values.

Connect to X Layer in one line

Swap your current endpoint for Nadcab RPC and keep your existing ethers, viem, web3.js or Solana code:

https://rpc.nadcab.com/xlayer/<your-api-key>

Get a X Layer Endpoint →

When you need archive data on X Layer

Archive access matters when “latest state” is not enough. An archive node preserves historical state needed to answer old storage queries exactly as they were at prior blocks. This is different from just having old blocks and receipts.

Common archive use cases

  • Historical token balances at specific block heights for accounting or proofs.
  • Backtesting strategies against contract state over time.
  • Forensics after protocol incidents or treasury movements.
  • Migration tools that verify old contract storage before upgrades.
  • Analytics pipelines that need reproducible historical reads.

For example, if you call eth_call at an old block to inspect a vault share price or a lending market variable, a standard full node may not retain the required historical state. Your call may fail or return incomplete results depending on node configuration.

Archive nodes are not needed for every product, but they are critical when correctness depends on what storage contained at a past block. Treat archive access as a workload requirement, not a nice-to-have feature.

Workload Full node usually enough Archive recommended
Wallet balances and sends Yes No
Recent event syncing Yes No
Historical state reads at old blocks No Yes
Incident forensics Sometimes Usually
Backtesting contract logic No Yes
Basic dApp frontend reads Yes No

If your team is designing data-heavy systems, Nadcab’s article on financial app RPC architecture is a useful companion because it frames RPC as a product reliability issue, not just a node choice.

How debug and trace APIs help with indexing and incident response

Standard JSON-RPC methods tell you what happened at a high level. Debug and trace APIs help explain how it happened. That distinction matters when you are indexing internal value flows, diagnosing failed transactions, or auditing protocol behavior after an outage.

Why traces matter

An EVM transaction can trigger many internal calls across contracts. Those internal calls may move value, create contracts, or revert deep inside nested execution. Standard receipts do not always expose enough detail for analytics or debugging.

Trace-capable infrastructure helps with tasks like:

  • Understanding internal calls for swap routing or aggregator flows.
  • Identifying where a transaction reverted.
  • Rebuilding protocol actions not surfaced as events.
  • Validating indexer output against execution traces.
  • Comparing expected and actual call paths after a release.

Incident response example

Suppose users report failed deposits after a contract upgrade. Your logs show reverted transactions, but not the internal step that broke. A trace view can reveal whether the revert came from a token transfer, a proxy delegate call, or a changed authorization check. That shortens time to mitigation.

Trace support should be evaluated early

Many teams wait until production to ask whether traces are available, rate-limited, or performant enough for batch jobs. That is late. If your roadmap includes indexing, fraud monitoring, or post-trade analysis, decide on trace requirements before you lock in your data pipeline design.

For broader context on node and RPC design, see Web3 infrastructure explained: nodes, RPCs, and APIs. It helps non-infrastructure teammates understand why not all RPC access is equivalent.

X Layer RPC architecture for wallets, backends, and data pipelines

The safest production pattern is to separate traffic by function. Do not make your indexer compete with your checkout flow for the same RPC budget if you can avoid it.

Wallet and frontend path

  • Fast reads for UI state.
  • Short request timeouts.
  • Avoid large block-range scans from the browser.
  • Use WebSocket subscriptions only where they clearly improve UX.

Backend transaction path

  • Dedicated retry logic for eth_sendRawTransaction and receipt polling.
  • Idempotent job processing around user actions.
  • Nonce management isolated per signer.
  • Circuit breakers for upstream RPC errors.

Indexer and analytics path

  • Chunk eth_getLogs requests by block range.
  • Persist cursors so reorg recovery is deterministic.
  • Use archive or trace-capable endpoints when required.
  • Run backfills separately from real-time consumers.

If your app spans multiple chains, a single gateway can simplify this design. Nadcab RPC exposes HTTPS and WebSocket access across supported networks with one API key, which helps standardize provider code and secret management across environments. Teams that need stronger isolation can move beyond shared endpoints later without rewriting every integration.

Pick the RPC setup that fits your stage

  • Nadcab Cloud: shared, auto-scaling endpoints for dApps and wallets
  • Nadcab Core: bring your own nodes and add our smart routing engine
  • Nadcab Craft: dedicated clusters, custom auth, compliance logging and enterprise SLA
  • Nadcab for Chains: RPC infrastructure for new L1 and L2 networks

Start Building Free →Read the Docs

How to scale X Layer RPC with shared, dedicated, or self-managed nodes

There is no single best model. The right choice depends on control, isolation, and how much operational burden your team wants to carry.

Model Best for Trade-offs
Shared gateway Fast launches, standard app traffic, small teams Less infrastructure control
Dedicated cluster Compliance, noisy-neighbor isolation, custom policies Higher planning and integration effort
Self-managed nodes with routing layer Teams that need node ownership plus managed traffic steering Operational complexity remains partly in-house

Shared endpoints

For many teams, shared auto-scaling endpoints are the right starting point. Nadcab Cloud fits this model and is useful when you want production-ready access without maintaining nodes.

Dedicated infrastructure

If you need custom authentication, compliance logging, or stricter isolation for critical workloads, dedicated clusters are a better fit. Nadcab Craft is designed for that kind of environment.

Your nodes with managed routing

Some technical founders want node ownership for policy or data reasons, but still want smart routing and a unified gateway. Nadcab Core fits that middle ground by combining your nodes with Nadcab’s routing engine.

Regardless of model, look for operational basics: a clear status page, region and provider failover, and observability around errors. Nadcab RPC publishes a live status page and targets 99.99% gateway uptime.

How to connect to X Layer RPC with one API key

The endpoint pattern is straightforward:

https://rpc.nadcab.com/xlayer/<your-api-key>

You can create a key from the Nadcab RPC login page and manage usage through the console at console.nadcab.com.

Using viem

import { createPublicClient, http } from 'viem';

const client = createPublicClient({
  transport: http('https://rpc.nadcab.com/xlayer/<your-api-key>')
});

const blockNumber = await client.getBlockNumber();
console.log(blockNumber);

Using web3.js

import Web3 from 'web3';

const web3 = new Web3('https://rpc.nadcab.com/xlayer/<your-api-key>');
const chainId = await web3.eth.getChainId();
const latest = await web3.eth.getBlockNumber();

console.log({ chainId, latest });

If you are standardizing setup across teams, Nadcab’s guide on Web3 API integration, authentication, error handling, and RPC setup is worth bookmarking.

Stop overpaying for RPC requests

Nadcab Cloud starts at $10 with no rate tiers: you pay $0.375 per 1M compute units and scale up or down without contracts. Every plan includes archive and WebSocket access on supported networks.

See RPC Pricing →or start free

Checklist for choosing an X Layer RPC provider

Use this checklist before you commit your production traffic:

  • Network support: Does the provider support X Layer directly and document the endpoint format clearly?
  • Access type: Do you need only full node access, or also archive and trace capabilities?
  • Transport: Do you need both HTTPS and WebSocket?
  • Routing and uptime: Is there smart routing, failover behavior, and a public status page?
  • Scaling model: Can you start shared and move to dedicated or hybrid later?
  • Developer ergonomics: Does it work cleanly with ethers.js, viem, and web3.js?
  • Pricing clarity: Are charges simple enough to forecast from request patterns?
  • Operational fit: Do you need custom auth, compliance logging, or enterprise controls?

With Nadcab RPC, pricing is usage-based at $0.375 per 1M compute units, and Nadcab Cloud starts from $10 with no rate tiers. That simplicity can help technical founders estimate cost without modeling multiple plan thresholds.

For readers comparing broader infrastructure patterns, these Nadcab Labs resources can help: node infrastructure for dApps, X Layer RPC node options, traces, and scaling, and Nadcab’s Web3 development services if you need implementation help.

Final Thoughts

X Layer RPC decisions should start with workload, not marketing labels. If your app only reads current state and sends transactions, a full node RPC is often enough. If you need historical storage, reproducible analytics, or deep incident forensics, archive and trace support become first-order requirements.

The cleanest way to choose is to map each product path, wallet, backend, and indexer to the exact RPC features it needs. Then match that to a scaling model: shared for speed, dedicated for isolation, or hybrid for control. If you want a managed option for X Layer with one API key, consistent endpoints, and room to grow across supported networks, Nadcab RPC is a practical starting point.

Ship faster on infrastructure you don’t have to babysit

Get one API key for 70+ networks, HTTPS and WebSocket endpoints, smart routing and a live status page. Building something bigger? Our blockchain team can design and run the full stack with you.

Get Your Free API Key →Talk to Our Experts

Pay as you go · No rate tiers · 99.99% gateway uptime target

Frequently Asked Questions

Q1.What is the X Layer RPC endpoint format for Nadcab RPC?

A1.

The X Layer endpoint format is https://rpc.nadcab.com/xlayer/. You create an API key, insert it into that path, and use the resulting URL with standard JSON-RPC clients such as ethers.js, viem, or web3.js. The same pattern helps simplify multi-network configuration across environments.

Q2.Do I need an archive node for X Layer?

A2.

You need archive access only if your workload depends on historical state at older blocks. Examples include forensic analysis, backtesting, accounting snapshots, and old storage reads through eth_call. If your app mainly reads current balances, estimates gas, and sends transactions, a full node RPC is usually enough.

Q3.Why are trace APIs important for X Layer developers?

A3.

Trace APIs help you inspect internal contract calls that standard transaction receipts do not fully expose. They are useful for debugging failed transactions, understanding router behavior, reconstructing protocol actions, and validating indexer output. If your product relies on deep execution visibility, evaluate trace support before production launch.

Q4.Can I use Nadcab RPC for more than just X Layer?

A4.

Yes. Nadcab RPC is a multi-chain RPC gateway with 70+ networks and 150+ endpoints, using one API key across supported chains. That is useful if your X Layer app also touches Ethereum, Base, Arbitrum, Solana, or other listed networks and you want a consistent integration pattern.

Q5.How should I scale an X Layer RPC setup as traffic grows?

A5.

Start by separating user-facing reads, transaction submission, and indexing workloads. Shared endpoints are often enough for launch. Move to dedicated infrastructure when you need stronger isolation, custom auth, or compliance logging. A hybrid model can also work if you want your own nodes combined with managed routing and failover.

Explore Services

Reviewed by

Aman Vaths profile photo

Aman Vaths

Founder of Nadcab Labs

Aman Vaths is the Founder & CTO of Nadcab Labs, a global digital engineering company delivering enterprise-grade solutions across AI, Web3, Blockchain, Big Data, Cloud, Cybersecurity, and Modern Application Development. With deep technical leadership and product innovation experience, Aman has positioned Nadcab Labs as one of the most advanced engineering companies driving the next era of intelligent, secure, and scalable software systems. Under his leadership, Nadcab Labs has built 2,000+ global projects across sectors including fintech, banking, healthcare, real estate, logistics, gaming, manufacturing, and next-generation DePIN networks. Aman’s strength lies in architecting high-performance systems, end-to-end platform engineering, and designing enterprise solutions that operate at global scale.