cast chain-id
NAME
cast-chain-id - Get the Ethereum chain ID.
SYNOPSIS
cast chain-id
[options]
DESCRIPTION
Get the Ethereum chain ID from the RPC endpoint we are connected to.
OPTIONS
RPC Options
--rpc-url
url
The RPC endpoint. Accepts a URL or an existing alias in the [rpc_endpoints] table, like mainnet
.
Environment: ETH_RPC_URL
Common Options
-h
--help
Prints help information.
EXAMPLES
-
Get the chain ID when talking to
$RPC
:cast chain-id --rpc-url $RPC
-
Get the chain ID when
$ETH_RPC_URL
is set:cast chain-id