1

I want to add a forked network to brownie. If i do it like this:

brownie networks add development polygon-main-fork-dev cmd=ganache-cli host=http://127.0.0.1 chainid=137 fork='https://polygon-mainnet.g.alchemy.com/v2/[apikey_not_shown_here]' accounts=10 mnemonic=brownie port=8545 

the added network has the chain id 1, but this is not correct for a polygon fork. Adding the chain-id like this

brownie networks add development polygon-main-fork-dev cmd=ganache-cli host=http://127.0.0.1 chainid=137 fork='https://polygon-mainnet.g.alchemy.com/v2/[apikey_not_shown_here]' accounts=10 mnemonic=brownie port=8545 chainid=137

leads to an error

ValueError: Unknown field(s): chainid

what is the correct way to add a chain-id to a brownie network? (The built in network polygon-main-fork has the correct chain_id so i think there must be a way to add the chain_id)

1 Answer 1

0

As per Brownie network management docs,the parameter is not chainid, it is chain_id.

So it's

brownie networks add development polygon-main-fork-dev cmd=ganache-cli host=http://127.0.0.1 chain_id=137 fork='https://polygon-mainnet.g.alchemy.com/v2/[apikey_not_shown_here]' accounts=10 mnemonic=brownie port=8545

Your Answer

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

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