Axceus
Axceus

Reputation: 407

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

in terminal I am using:

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

it 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

I checked the function for the importlib, its looking for the cmd key, but it seems like its not willing to accept the ganche-cli or that cmd is not a valid key when the import lib is looking for a cmd key.

Could this be because the brownie networks list shows a mainnet fork with ganache-cli in the networks list even though the new name would be 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

Upvotes: 1

Views: 379

Answers (1)

Akash senta
Akash senta

Reputation: 493

as per command you have mentioned looks like it has missing format for port

please find below correct command with 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

all values in command should be key=value pair.

Upvotes: 2

Related Questions