zksync-cli config chains

Configure custom chains to use with zksync-cli.

Specify your own chain configuration by adding or editing custom chains to use on zksync-cli. This feature is essential for developers looking to interact with ZK Stack Chains.

Configuring Custom Chains

To add or edit a custom chain, use the following command:

zksync-cli config chains

Upon execution, you will be guided through a series of prompts to enter specific details for the custom chain, including:

  • Chain ID: The id for the chain.
  • Chain Name: A name for the chain.
  • Chain key: A unique identifier for the chain.
  • RPC URL: The RPC endpoint URL for interacting with the chain.
  • Other Information: Depending on the chain's requirements, you may need to provide additional information such as block explorer URLs.

Using Custom Chains

Once a custom chain is configured, you can use it across various zksync-cli commands. All of your custom chains will be listed in the chain selection prompt, allowing you to select and use them as needed. You can also specify a custom chain directly using the --chain option, for example:

zksync-cli wallet balance --chain <custom-chain-key>

Made with ❤️ by the ZKsync Community