Skip to main content
POST
net_version
curl --request POST \
  --url https://rpc.testnet.tempo.xyz/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "net_version",
  "params": [],
  "id": 1
}
'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": "<string>"
}
Tempo API method that returns the current network ID. The Tempo testnet network ID is 42429.

Parameters

  • none

Response

  • result — the network ID as a string (42429 for Tempo testnet)

net_version code examples

const Web3 = require("web3");
const NODE_URL = "CHAINSTACK_NODE_URL";
const web3 = new Web3(NODE_URL);

async function getNetworkId() {
  const networkId = await web3.eth.net.getId();
  console.log(`Network ID: ${networkId}`);
}

getNetworkId()

Body

application/json
jsonrpc
string
default:2.0
method
string
default:net_version
params
any[]
id
integer
default:1

Response

200 - application/json

The network ID

jsonrpc
string
id
integer
result
string

The network ID (42429 for Tempo testnet)