← Base overview
Base · net
net_version
Returns the current network ID. This is usually equivalent to the chainID, but may differ from it for some legacy networks or special testnets.
Result
Network ID
Schema
{
"type": "string",
"title": "decimal unsigned integer string",
"pattern": "^(0|[1-9][0-9]*)$"
}Example request
Endpoint: https://your-base-node.azxa.io
JSON-RPC
{
"jsonrpc": "2.0",
"id": 1,
"method": "net_version",
"params": []
}Example response
{
"jsonrpc": "2.0",
"id": 1,
"result": "1"
}Test fixture
Fixture: get-network-id
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "net_version"
}Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "3503995874084926"
}cURL
curl -X POST https://your-base-node.azxa.io \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"net_version","params":[]}'