curl --request POST \
--url https://tempo-mainnet.core.chainstack.com/c3ce2925b51f1ed18719fe8a23bbdccf/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_chainId",
"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": "eth_chainId",
"params": [],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}Tempo API method that returns the chain ID of the current network. The Tempo mainnet chain ID isDocumentation Index
Fetch the complete documentation index at: https://chainstack-mintlify-flesh-empty-pages.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
4217 (0x1079 in hexadecimal). The Moderato testnet chain ID is 42431 (0xa5bf).
noneresult — the chain ID encoded as hexadecimal (0x1079 for Tempo mainnet / 0xa5bf for Moderato testnet)eth_chainId code examplesconst Web3 = require("web3");
const NODE_URL = "CHAINSTACK_NODE_URL";
const web3 = new Web3(NODE_URL);
async function getChainId() {
const chainId = await web3.eth.getChainId();
console.log(`Chain ID: ${chainId}`);
}
getChainId()
Was this page helpful?