In the chain network system, there will be various, large and small application chains, vertical industry chains, and the development environment supports the launch of multiple chains, which is very convenient for developers when testing cross-chain characteristics.
Forge CLI multi-chain support is available at
v0.35.0 Added in version.
Forge CLI's multi-chain support is implemented based on the file system. Each node of the chain has its own configuration and data storage directory. The information storage locations are as follows:
When there are multiple chains, when the Forge CLI receives a certain instruction, it will see if the user has specified a certain chain. If not, it will search according to the following rules:
- Finding currently running chains
- If there are running chains, arrange the running chain names in ascending alphabetical order, and take the first as the default chain
- If there are no running chains, the names of all chains are listed in ascending alphabetical order, and the first one is taken as the default connection.
The basic syntax of multi-chain operation is as follows:
forge web start | stop [--chain-name | -c <chain name>]