curl --request POST \
--url https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4 \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "zks_L1ChainId",
"params": []
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"chainId": 123
}
}
curl --request POST \
--url https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4 \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "zks_L1ChainId",
"params": []
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"chainId": 123
}
}
none
result
— the chain ID of the underlying L1 network, returned as a hexadecimal string.zks_L1ChainId
provides a straightforward way to verify the L1 network their applications are operating on programmatically. This is particularly useful for applications that are deployed across multiple environments to avoid common pitfalls such as contract interaction on an unintended network, which can lead to loss of funds or data integrity issues.Successful response
The response is of type object
.
Was this page helpful?