PatrickAlphaC / brownie_fund_me

26 stars 64 forks source link

account not accessible through brownie accounts while using --network ganache-local #35

Closed babe8901 closed 2 years ago

babe8901 commented 2 years ago

(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.

PatrickAlphaC commented 2 years ago

Can you ask this on the main repo? Thanks!

https://github.com/smartcontractkit/full-blockchain-solidity-course-py

babe8901 commented 2 years ago

I got this figured out. Looks like it did not work because I set the host to http://0.0.0.0:8545 instead of http://127.0.0.1:8545. I saw the instructor use the former one and it worked, but not for me. Must be something with ganache, I guess.