0
(eth-brownie) PS C:\Users\lucky\Desktop\Investing\Courses\Solidity\demos\brownie_fund_me> brownie run scripts/deploy.py --network ganache-local
INFO: Could not find files for the given pattern(s).
Brownie v1.18.1 - Python development framework for Ethereum

BrownieFundMeProject is the active project.

Running '\Users\lucky\Desktop\Investing\Courses\Solidity\demos\brownie_fund_me\scripts\deploy.py::main'...
File "C:\Users\lucky.local\pipx\venvs\eth-brownie\lib\site-packages\brownie_cli\run.py", line 51, in main
return_value, frame = run(
File "C:\Users\lucky.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\project\scripts.py", line 103, in run
return_value = f_locals[method_name](*args, **kwargs)
File "\Users\lucky\Desktop\Investing\Courses\Solidity\demos\brownie_fund_me\scripts\deploy.py", line 31, in main
deploy_fund_me()
File "\Users\lucky\Desktop\Investing\Courses\Solidity\demos\brownie_fund_me\scripts\deploy.py", line 10, in deploy_fund_me
account = get_account()
File ".\scripts\helpful_scripts.py", line 12, in get_account
return accounts[0]
File "C:\Users\lucky.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\account.py", line 115, in getitem
return self._accounts[key]
IndexError: list index out of range

I can run the chain locally and on the rinkeby testnet, but when I run it using --network ganache-local, it is throwing this error. I think it is not able to get the account address.

1 Answer 1

0

When you have ganache running in the background, brownie will tell you which host it is using to connect. This can be found if you run brownie run scripts/deploy.py

Mine ended up seeing host 127.0.0.1 instead of the host that I used for my ganache-local network.

To change the host for your network, try brownie networks modify ganache-local host=http://127.0.0.1:8545

1
  • I set the host=http://0.0.0.0:8545 as I had configured ganache that way but it wasn't working. But when I configured host=http://127.0.0.1:8545 it worked. I think we need to specify ganache, the exact IP and port number for it to function as you rightly mentioned. Thanks for the help.
    – babe8901
    Apr 3, 2022 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.