Skip to content

Commit

Permalink
fix: use the network host parameter when launching local rpc nodes et…
Browse files Browse the repository at this point in the history
  • Loading branch information
danceratopz committed May 17, 2022
1 parent d596cb2 commit 61d8666
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion brownie/network/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def connect(network: str = None, launch_rpc: bool = True) -> None:
)
rpc.attach(host)
else:
rpc.launch(active["cmd"], **active["cmd_settings"])
cmd_args = active["cmd_settings"]
cmd_args["host"] = active["host"].replace("http://", "")
rpc.launch(active["cmd"], **cmd_args)
else:
Accounts()._reset()
if CONFIG.network_type == "live" or CONFIG.settings["dev_deployment_artifacts"]:
Expand Down
3 changes: 3 additions & 0 deletions brownie/network/rpc/ganache.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

CLI_FLAGS = {
"7": {
"host": "--server.host",
"port": "--server.port",
"gas_limit": "--miner.blockGasLimit",
"accounts": "--wallet.totalAccounts",
Expand All @@ -35,6 +36,7 @@
"unlimited_contract_size": "--chain.allowUnlimitedContractSize",
},
"<=6": {
"host": "--host",
"port": "--port",
"gas_limit": "--gasLimit",
"accounts": "--accounts",
Expand Down Expand Up @@ -166,6 +168,7 @@ def _validate_cmd_settings(cmd_settings: dict) -> dict:
ganache_keys = set(k for f in CLI_FLAGS.values() for k in f.keys())

CMD_TYPES = {
"host": str,
"port": int,
"gas_limit": int,
"block_time": int,
Expand Down

0 comments on commit 61d8666

Please sign in to comment.