Using Brownie to Switch between Different Networks
In this article, we are going to switch between the different available networks we can connect to, using Brownie. Then, we'll write a statement in the Deploy.py to connect to the network requested in the terminal by the user (the developer). This kind of script for network management makes it easy for us to connect to any network that we want at any time it is required for testing and other purposes.
How to Switch between Networks
As you know, we have different networks to work with. We have already used some of them for deploying our contracts . Sometimes we need to write our deploy.py file in a way that we can switch between different networks and accounts and the deploy.py must understand which ones are available.
Switch between Different Networks
Before we get started with this task, we can check the keywords when we want to connect to different accounts. To look up the keyword related to any network, we write:
Coppied to clipboard.
brownie ...