Global configuration refers to ~/.forgerc.yml Custom configurations supported in the file. Some of these configurations can be specified through command line parameters. For detailed configuration item explanations, see the following 配置项one period. So how do you set up these configurations?

forge config command

Added in CLI v0.39.24

Of course, it can be edited directly ~/.forgerc.yml File to modify but CLI In 0.39.24 Added in version forge config Command to configure these global variables.

View current configuration items

View a certain configuration item

Setting configuration items

Configuration item

allowMultiChain

Boolean (bool), whether to allow the creation of multiple chains.

Optional values:

  • true: Allowed. In this case, multiple chains can be created locally for easy development and debugging. It is recommended to use it in a development environment.
  • false: not allowed, in this case CLI Will be used forge starter To start the chain, the stability is better, it is recommended to use it in a production environment

Default: true

configPath

String, custom forge config File location. If specified, CLI The configuration is read, in which case there is no need to explicitly create a chain, and subsequent operations can also be performed.

Default: not set

Command line arguments: -i, --config-path

defaults

Boolean (bool), whether the interactive command appears to use the default value.

Default: false

Command line arguments: -d, --defaults

Optional values:

  • true: When there is an interactive operation, the CLI will use the default value of the operation
  • false: When there is an interactive operation, the CLI will prompt the developer to fill in the information

mirror

String, custom image address. If set, download, install, etc. and Forge When release-related operations are performed, CLI The mirror address is used.

Default: not set

Command line arguments: -m, --mirror

moderatorSecretKey

String, moderator private key (SK), if the administrator private key was not specified when the chain was created, and was not found in the system environment variables, the administrator private key automatically generated by Forge CLI will be stored In this configuration item.

Default: not set

npmRegistry

String, custom npm Mirror address. If not set CLI Read by default ~/.npmrc Configuration.

Default: not set

Command line arguments: -r, --npm-registry

releaseDir

String, using the local disk as the Forge distribution download image. It is relatively infrequently used, and some may need to deploy and use the Forge CLI in a local area network. For specific usage reference Here

Default: not set

example