Replies: 1 comment
-
Thank you for this!!! This is great! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As I myself struggled with this particular problem when I started this course and could not find any information regarding this in the repository. I thought I'd share this with you to save your time and to help you all in your journey.
Note: I would be working with Sepolia but this process can work for any testnet.
First off you are gonna need to sign up with Alchemy.
Once all set, open up the .env file from the repo in VS Code and change your WEB3_INFURA_PROJECT_ID to:
export WEB3_INFURA_PROJECT_ID=https://eth-sepolia.g.alchemy.com/v2/YOUR-API-KEY
Next set up a MetaMask account, we can use the account private key and some slick Brownie commands in order to add the account into the fold of our Brownie accounts object. To try it out:
Use the following command to add a new account:
Here, my-new-account is the unique id for referring to the new account. You can give your own id for the account. When we execute this command, Brownie will ask us to enter the private key of the account and also prompt us for a password for encrypting the account details.
Once you generate the new account, you can view it using the following command:
This will display all the local (ones that are stored in the system) accounts that we can access:
At last, use the brownie networks add command with the node endpoint. For example, Ethereum mainnet:
brownie networks add Ethereum ID name="NETWORK_NAME" host= YOUR_CHAINSTACK_ENDPOINT chainid=NETWORK_ID
Where,
Exact command:
brownie networks add Ethereum sepolia name="Sepolia (Alchemy)" host=https://eth-sepolia.g.alchemy.com/v2/YOUR-API-KEY chainid=11155111
To verify if your network was added successfully you can run the following command:
You should be able to see your network under the Ethereum header
Example to run the deployment script relevant with this repo:
I implemented the above stated steps and I was able to work with the Sepolia Testnet. These steps should be enough I suppose, if not down below you can find the shared information and more if you are still struggling to find a solution.
References:
--> https://chainstack.com/the-brownie-tutorial-series-part-2/#4-using-testnets
--> https://docs.chainstack.com/docs/ethereum-tooling#metamask
--> https://www.codeforests.com/2022/01/27/python-brownie-network-setup/
Beta Was this translation helpful? Give feedback.
All reactions