Docs
Docs
Home
Getting Started
Agent Tooling
CLI
Supported Chains
Acala
Aptos
Arbitrum
Arc
Asset Hub
Astar
Avalanche
Base
Berachain
Bifrost
Binance Smart Chain
Bittensor
Blast
Boba Network
Bridge Hub
Celo
Centrifuge
Chiliz
Cronos
Enjin
Ethereum
Etherlink
Flow EVM Gateway
Gnosis
Hydration
Hyperliquid
Immutable
Ink
IoTeX
Kusama
Linea
LISK
Manta Atlantic
Manta Pacific
Mantle
MegaETH
Monad
Movement
Neuroweb
opBNB
Optimism
Plasma
Polkadot
Polygon
Pulsechain
Robinhood
Ronin
Scroll
Sonic
Starknet
Taiko
Tempo
Sui
TRON
Unichain
Viction
World Chain
XDC Network
XX Network
Zetachain
zkSync Era
Zora
Supported ChainsTRONEthereum JSON-RPC APINetwork Methods

net_version - TRON RPC Method

Get the current network ID on TRON. Useful for endpoint identification and multi-network routing.

TRON RPC endpoint: endpoint URLs, plans and pricing.

Returns the current network ID on TRON as a decimal string. The network ID identifies which network the node is connected to.

Why TRON? Build on the TVM-compatible Layer 1 for TRC-20 payments, wallet APIs, and low-cost smart contract execution with TVM compatibility paired with native TRON wallet APIs, DPoS block production, and low-cost transaction flows.

When to Use This Method

net_version is essential for TRON developers building payment rails, exchanges, and consumer crypto applications:

  • Endpoint Identification - Confirm your application is connected to the expected TRON network
  • Multi-Chain App Routing - Dynamically detect which network an RPC endpoint serves and route logic accordingly
  • Connection Validation - Perform a quick sanity check during node or provider initialization

Current Network ID

TRON mainnet currently returns 0x2b6653dc from both net_version and eth_chainId on Dwellir's shared JSON-RPC endpoint. Treat that value as the canonical identity check when you are validating routing, signing, or environment selection in production code.

JSON-RPC request
{
  "jsonrpc": "2.0",
  "method": "net_version",
  "params": [],
  "id": 1
}

Code Examples

Common Use Cases

1. Gate startup on the expected TRON network ID

JavaScript
async function assertTronMainnet(provider) {
  const networkId = await provider.send('net_version', []);

  if (networkId !== '0x2b6653dc') {
    throw new Error(`Unexpected TRON network ID: ${networkId}`);
  }

  return networkId;
}

2. Cross-check net_version and eth_chainId

JavaScript
async function readTronIdentity(provider) {
  const [networkId, chainId] = await Promise.all([
    provider.send('net_version', []),
    provider.send('eth_chainId', []),
  ]);

  console.log({ networkId, chainId });

  if (networkId !== chainId) {
    throw new Error(`TRON identity mismatch: ${networkId} vs ${chainId}`);
  }

  return { networkId, chainId };
}

3. Route environment-specific config

Python
TRON_NETWORKS = {
    '0x2b6653dc': 'tron-mainnet',
}

def resolve_tron_environment(network_id: str) -> str:
    if network_id not in TRON_NETWORKS:
        raise ValueError(f'Unsupported TRON network id: {network_id}')

    return TRON_NETWORKS[network_id]

Best Practices

  • Use eth_chainId for transaction signing (EIP-155 replay protection) -- net_version is for network identification only
  • Cache the network ID at startup -- it does not change during a session
  • Some L2 and sidechain networks share the same network ID as their L1 -- always combine with eth_chainId for unambiguous identification
  • For multi-chain dApps, maintain a mapping of network IDs to chain-specific contract addresses and RPC endpoints
  • The net_* namespace may be disabled on some node configurations -- handle the -32601 error gracefully

Error Handling

Error CodeDescriptionSolution
-32601Method not foundThe node may have the net namespace disabled -- check node startup flags
-32603Internal errorNode may be starting up -- retry after delay
-32005Rate limit exceededReduce polling frequency or implement backoff

Related Methods

  • eth_chainId - Get the EIP-155 chain ID (preferred for transaction signing)
  • net_listening - Check whether the client reports peer-listening state
  • net_peerCount - Get number of connected peers
  • eth_syncing - Check node sync progress

eth_syncing

Check the sync status of your TRON node. Returns sync progress or false when fully synced - essential for node health monitoring and dApp reliability.

net_listening

Check the legacy net_listening compatibility method on TRON. Public endpoints may return a boolean or an unsupported-method response depending on the client.

On this page

When to Use This MethodCurrent Network IDCode ExamplesCommon Use Cases1. Gate startup on the expected TRON network ID2. Cross-check net_version and eth_chainId3. Route environment-specific configBest PracticesError HandlingRelated Methods