curl --request POST \
--url https://tempo-mainnet.core.chainstack.com/c3ce2925b51f1ed18719fe8a23bbdccf/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "net_version",
"params": [],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}curl --request POST \
--url https://tempo-mainnet.core.chainstack.com/c3ce2925b51f1ed18719fe8a23bbdccf/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "net_version",
"params": [],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}4217. The Moderato testnet network ID is 42431.
noneresult — the network ID as a string (4217 for Tempo mainnet, 42431 for Moderato testnet)net_version code examplesconst 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()
Was this page helpful?