First, make sure that Brownie is able to connect to your private network. You will likely have to modify the configuration file within your project. Here is an example of configuration settings to declare to a persistent network with the name "private" at
127.0.0.1, port 8545:
The simplest way to deploy is via a deployment script. Here is an example deployment script for a basic ERC20, taken from the documentation:
from brownie import *
accounts.deploy(Token, "Test Token", "TEST", 18, "1000 ether")
Save your deployment script within the
scripts/ folder of your project.
To run the script on your local network, use the
--network flag. For example, to run a deployment script named
deployment.py on a network named "private" within the configuration file:
brownie run deployment --network private
If you have set
persist: true in the project configuration settings for this network, Brownie will retain information about the deployed contract. When you run Brownie again, an object to interact with deployed contract will already be available. You can read more about persistence here.