- Create a new folder for your project and open VC code on that folder.
- Install Python3:
$ brew install python3
- Install Ganache:
$ npm install ganache --global
$ ganache
- Install pipx and Brownie:
$ python3 -m pip install --user pipx
$ python3 -m pipx ensurepath
$ pipx install eth-brownie
- Alternately, you could install via pip:
pip install eth-brownie
- Initiate your Brownie environment:
$ brownie -- version
$ brownie init
$ ls
- Explore folders that Brownie prepare for us: build, contracts, interfaces, scripts, tests, etc.
- Copy the file StoreValue.sol to the new created contract folder and compile it:
brownie compile
- Explore the json generated in the build folder.
- Add your Goerli account to Brownie. Get your private key from Metamask:
brownie accounts new my-goerli-account
- List your available accounts:
brownie accounts list
- Copy the file scripts/deploy.py file into your scripts folder and run it:
brownie run scripts/deploy.py
- Copy the file test/test_store_value.py and run:
brownie test -s
- Create a project at Infura. Then, go to settings and find your project ID from the networks endpoints.
https://mainnet.infura.io/v3/<PROJECT ID>
-
Add an environment variable for this project ID. For this, copy and update the .env and brownie-config.yaml files.
-
Deploy the contract in Goerli:
brownie run scripts/deploy.py --network goerli
- Observe the changes in your wallet every time you execute it.