Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Use network host parameter when launching local rpc network node #1534

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

danceratopz
Copy link

@danceratopz danceratopz commented May 17, 2022

What I did

I modified brownie so that the host parameter configured with the networks CLI is now used when launching a local RPC network node. This is required to enable use with dockerized RPC clients (host in this case must be set to 0.0.0.0).

Related issue: #1533

How I did it

I made some small changes to brownie/networks/rpc/*.py.

How to verify it

The modifications to the fixtures and units tests in this PR test that the network node launches and correctly configures the host parameter.

They do not test that the parameter is correctly passed from networks CLI though, this can be verified locally very easily by modifying the host parameter via the CLI and starting hardhat/ganache:

Ganache:

brownie networks modify development host="http://127.0.0.2"
brownie console --network development
# ->
# Launching 'ganache-cli --accounts 10 --hardfork istanbul --gasLimit 12000000 --mnemonic brownie --port 8545 --host 127.0.0.2'...

Hardhat:

brownie networks modify hardhat host="http://127.0.0.2"
brownie console --network hardhat
# ->
# Launching 'npx hardhat node --port 8545 --hostname 127.0.0.2'

Checklist

  • I have confirmed that my PR passes all linting checks
  • I have included test cases
  • I have updated the documentation
  • I have added an entry to the changelog

black 22.1.0 was incompatible with a newer version of click. This was fixed in black 22.3.0, see psf/black#2964
…wnie#1533

Modify fixtures and tests to use a different host ip when launching a temporary rpc network node. This demonstrates that the host parameter is not respected when launching the node.
@danceratopz
Copy link
Author

I didn't manged to get the py39 tests to pass on Windows (https://github.com/danceratopz/brownie/actions/workflows/core-ganache-3.9.yaml). Problems with web3.py causing flakiness on Windows?

This PR would also solve #1312.

@danceratopz danceratopz marked this pull request as ready for review May 17, 2022 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant