← Taiko overview
Taiko · eth
eth_chainId
Returns the chain ID of the current network.
Result
Chain ID
Schema
{
"type": "string",
"title": "hex encoded unsigned integer",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$"
}Example request
Endpoint: https://your-taiko-node.azxa.io
JSON-RPC
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_chainId",
"params": []
}Example response
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x28c58"
}Test fixture
Fixture: get-chain-id
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_chainId"
}Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xc72dd9d5e883e"
}cURL
curl -X POST https://your-taiko-node.azxa.io \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'