brownie "ValueError: Arguments must be given as key=value" when adding new development network

brownie "ValueError: Arguments must be given as key=value" when adding new development network

在我正在使用的终端中:

brownie networks add development mainnet-fork-dev cmd=ganache-cli host=http://127.0.0.1 fork=https://eth-mainnet.alchemyapi.io/v2/lo_6vVzK8nBRonb1Io5jBX3cX3XLTfR_ accounts=10 mnemonic=brownie port 7545

它returns:

Brownie v1.17.1 - Python development framework for Ethereum

  File "C:\Users\Axceus\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\brownie\_cli\__main__.py", line 64, in main
    importlib.import_module(f"brownie._cli.{cmd}").main()
  File "C:\Users\Axceus\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\brownie\_cli\networks.py", line 68, in main
    fn(*args["<arguments>"])
  File "C:\Users\Axceus\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\brownie\_cli\networks.py", line 111, in _add
    args = _parse_args(args)
  File "C:\Users\Axceus\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\brownie\_cli\networks.py", line 277, in _parse_args
    raise ValueError("Arguments must be given as key=value") from None
ValueError: Arguments must be given as key=value

我检查了 importlib 的功能,它正在寻找 cmd 键,但它似乎不愿意接受 ganche-cli 或者当导入库正在寻找 cmd 时 cmd 不是有效键关键。

这可能是因为 brownie 网络列表在网络列表中显示了带有 ganache-cli 的主网分支,即使新名称是 mainnet-fork-dev?

Development
  ├─Ganache-CLI: development
  ├─Geth Dev: geth-dev
  ├─Hardhat: hardhat
  ├─Hardhat (Mainnet Fork): hardhat-fork
  ├─Ganache-CLI (Mainnet Fork): mainnet-fork
  ├─Ganache-CLI (BSC-Mainnet Fork): bsc-main-fork
  ├─Ganache-CLI (FTM-Mainnet Fork): ftm-main-fork
  ├─Ganache-CLI (Polygon-Mainnet Fork): polygon-main-fork
  ├─Ganache-CLI (XDai-Mainnet Fork): xdai-main-fork
  └─Ganache-CLI (Avax-Mainnet Fork): avax-main-fork

根据您提到的命令,它似乎缺少 port

的格式

请使用 port=7545

在下面找到正确的命令
brownie networks add development mainnet-fork-dev cmd=ganache-cli host=http://127.0.0.1 fork=https://eth-mainnet.alchemyapi.io/v2/lo_6vVzK8nBRonb1Io5jBX3cX3XLTfR_ accounts=10 mnemonic=brownie port=7545

命令中的所有值都应该是 key=value 对。