Web3.py

ValueError:網路缺少必填欄位:chainid

  • April 4, 2022

添加另一個網路時,由於某種原因它無法辨識chainid。

root@DESKTOP-MIQQV4H:/mnt/c/users/user/documents/Blockchain/brownie_fund_me# brownie networks add Ethereum ganache-local host=http://127.0.0.1:8545 chaindid=5777
Brownie v1.17.2 - Python development framework for Ethereum

 File "brownie/_cli/__main__.py", line 64, in main
   importlib.import_module(f"brownie._cli.{cmd}").main()
 File "brownie/_cli/networks.py", line 68, in main
   fn(*args["<arguments>"])
 File "brownie/_cli/networks.py", line 138, in _add
   _validate_network(new, PROD_REQUIRED)
 File "brownie/_cli/networks.py", line 320, in _validate_network
   raise ValueError(f"Network is missing required field(s): {', '.join(missing)}")
ValueError: Network is missing required field(s): chainid

有誰知道怎麼了?

您必須在添加網路命令中輸入“chainid”的值,但它似乎是錯誤的名稱“chaindid”,刪除錯誤的“d”並享受!

這對我有用

brownie networks 添加開發 mainnet-fork cmd=ganache-cli host=http:127.0.0.1 fork=accounts=10 mnemonic=brownie port=7545

這沒有要求我提供鏈 ID

引用自:https://ethereum.stackexchange.com/questions/121626