cast-chain-id - Get the Ethereum chain ID.
cast chain-id
[options]
Get the Ethereum chain ID from the RPC endpoint we are connected to.
{{#include ../common/rpc-url-option.md}}
{{#include common-options.md}}
-
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