EXAMPLES

When providing a RPC endpoint URL:
cast chain --rpc-url https://eth.llamarpc.com
ethlive
Works with -r too:
cast chain -r https://polygon-rpc.com
polygon

DOCUMENTATION

import RpcUrlOption from "../../reference/common/rpc-url-optionx"; import CommonOptions from "./common-optionsx";

cast chain


NAME

cast-chain - Get the symbolic name of the current chain.

SYNOPSIS

cast chain [options]

DESCRIPTION

Get the symbolic chain name from the RPC endpoint we are connected to.

OPTIONS

RPC Options

<RpcUrlOption /> <CommonOptions />

EXAMPLES

  1. Get the chain name when talking to $RPC:

    cast chain --rpc-url $RPC
    
  2. Get the chain name when $ETH_RPC_URL is set:

    cast chain
    

SEE ALSO

cast, cast chain-id