Skip to main content
Tempo API method that returns the current network ID. The Tempo Moderato testnet network ID is 42431.

Parameters

  • none

Response

  • result — the network ID as a string (42431 for Tempo Moderato 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()