Skip to main content

net_version

POST

Returns the network version. In TRON JSON-RPC this value is the same as the chain ID.The value for Tron Mainnet, which Nodit supports, is 0x2b6653dc.

📘 Ethereum returns net_version as a decimal string (e.g. "1"), but TRON returns it in hexadecimal.

Responses
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "Unauthorized"
}
cURL
curl -X POST 'https://tron-mainnet.nodit.io' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "net_version",
"params": []
}'