Great Stuff Devil - made it through this one ok. Havent coded in 10+ yrs...but I still have the touch....had to go and download older versions of python and brownie to make it work, but I figured it out....lets go!!!
just fyi the eth address won't work if you copypaste it from substack because it isn't all on one line (i think, idk i'm a normie). pasting into notepad and deleting the line solved it for me
Yeah, substack's code formatting is really terrible and butchers long lines. In later lessons I post code to github and the Discord to work around the problem a bit.
yep test environment is up and running, able to send commands and so on to the python console, searching through the method dir is handy. enjoying it.
Short remark regarding this paragraph:
"Brownie, at a high level, is a framework that relies and wraps the functionality of the web3.py module, which has a more single-minded purpose: send and receive blockchain data and interact with smart contracts."
Is it "relies on" or "relays"? Sort of stumbled through that sentence a couple of times.
cool, thanks for updating. let me know if this kind of comment or remark are unwelcome. don't mind helping out with reviewing articles, or just text, for grammar/spelling and so on if you like any time.
Linux mint. Found out it could be related with sqlite not being present when building python from source, so might have to purge everything and then add it on the ./config step -> make -> altinstall...
Trying to fix my other problem I have a few questions to make sure I am not over looking something...I know when we create a new user with a new password it gives us the code. When it says to enter it...all it allows me to do is to hit enter (typing isn't an option). I think it is fine in the training however it makes me wonder if something is going on since it is important. When I hit enter I get
>>> user = accounts.load('test_account')
Enter password for "test_account":
File "<console>", line 1, in <module>
File "brownie/network/account.py", line 221, in load
priv_key = web3.eth.account.decrypt(
File "eth_account/account.py", line 155, in decrypt
It's common for command line tools to not print anything when you type in a password. Even though you think nothing is being entered, it's recording your keystrokes. Make a fresh account with a simple password and you'll see this is the case.
Phase I originally had just hit enter when asked for a password because it didn't allow me to type for some reason. And once again when I get to this part it doesn't allow me to type only hit enter to get "Value Error: MAC mismatch". Any idea what's going on here?
I suspect that the invisible password prompt jumbled you up, and you have a password set that you didn't intend. I recommend deleting the account with 'brownie accounts delete test_account' and starting over.
I run the main bot on a cloud VPS, but do my testing and experimental stuff on a local workstation. Brownie is pretty lightweight, so you don't need powerful hardware. Latency & uptime are far more important.
I don't have a Mac so I'm flying blind a bit here, but maybe I can help. What brownie version did you install, and did you do it using anaconda or pip? Does a bare 'brownie console' work without the network option?
Hey, i'm having the same problem. I have tried everything. I have gotten to the same point this person has also gotten to, and I'm getting the same error. My brownie version is v1.16.4, and I have tried to update that as well with pipx, also to no avail. I'm pretty green to coding and using the terminal, if you can't already tell lol.
Im on MacOS using vscode, and I used pip to install brownie. I also tried to do it with pipx after I was having problems but it didn't do anything. I can't seem to update brownie to the latest version. I'm getting the exact same error as this guy. I am also on M1 cpu if that means anything, I know that has made things screwy with other things since it's new. I'm just lost because I can't find anything on the internet about this error, I checked if I have all the right stuff downloaded and I do(I think).
I can help with the version at least. Try again with 'pip install eth-brownie==1.18.1' which will upgrade to the latest available version. I'll do some searching to uncover that hardhat error
Fantastic! I was trying to discover what Solidity contracts brownie was pre-installing through pip, assuming you were doing this from scratch. If you'd used solc before perhaps it created a stale cache that solc couldn't handle when brownie called it at console startup.
For those missing avax-main from brownie, I used the command below to add it:
❯ brownie networks add Avalanche avax-main host=https://api.avax.network/ext/bc/C/rpc explorer=https://api.snowtrace.io/api chainid=43114 name=Mainnet
Thanks! I've added that code block to the post above and credited you.
Great Stuff Devil - made it through this one ok. Havent coded in 10+ yrs...but I still have the touch....had to go and download older versions of python and brownie to make it work, but I figured it out....lets go!!!
Awesome walkthrough, thanks
just fyi the eth address won't work if you copypaste it from substack because it isn't all on one line (i think, idk i'm a normie). pasting into notepad and deleting the line solved it for me
Yeah, substack's code formatting is really terrible and butchers long lines. In later lessons I post code to github and the Discord to work around the problem a bit.
catching up... really good stuff, thanks Devil
Went thru this exercise without a hitch. Thanks Devil!
"And as a bonus, we’ll learn why the WAVAX contract’s balance was so large and why it didn’t have any decimal places."
not sure about the decimal if was explained why not there are no decimal places
Ah, my mistake it appears I split that explanation to another article. This one covers the decimal place stuff — https://degencode.substack.com/p/loading-a-token-smart-contract
so instead of "(.venc) name@pop-os:~/", I have "(.venv) (base) name@pop-os:~/" as the start of my commandline, just checking if this is a bad thing...
As long as the venv is active, the prompt is irrelevant. Does Brownie work otherwise?
yep test environment is up and running, able to send commands and so on to the python console, searching through the method dir is handy. enjoying it.
Short remark regarding this paragraph:
"Brownie, at a high level, is a framework that relies and wraps the functionality of the web3.py module, which has a more single-minded purpose: send and receive blockchain data and interact with smart contracts."
Is it "relies on" or "relays"? Sort of stumbled through that sentence a couple of times.
Other than that, solid piece, onto the next.
Should have been "relies on", I fixed the post 👍
cool, thanks for updating. let me know if this kind of comment or remark are unwelcome. don't mind helping out with reviewing articles, or just text, for grammar/spelling and so on if you like any time.
All good, when you find mistakes I'm glad to fix them and improve all of these lessons regardless of age.
note to self: activate venv on Windows using the Command Prompt: path\to\venv\Scripts\activate.bat
Hi Devil! I'm getting the following error while chacking the brownie version, can get a good answer in google, SO:
File "/usr/local/lib/python3.9/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
I've run pip3 install pysqlite3 just in case but it doesn't change anything. Brownie version is 1.17.2, running on Linux
What distro are you running? If it's Debian based, 'apt install python3-dev' tends to fix a lot of weird issues.
Linux mint. Found out it could be related with sqlite not being present when building python from source, so might have to purge everything and then add it on the ./config step -> make -> altinstall...
Trying to fix my other problem I have a few questions to make sure I am not over looking something...I know when we create a new user with a new password it gives us the code. When it says to enter it...all it allows me to do is to hit enter (typing isn't an option). I think it is fine in the training however it makes me wonder if something is going on since it is important. When I hit enter I get
>>> user = accounts.load('test_account')
Enter password for "test_account":
File "<console>", line 1, in <module>
File "brownie/network/account.py", line 221, in load
priv_key = web3.eth.account.decrypt(
File "eth_account/account.py", line 155, in decrypt
return HexBytes(decode_keyfile_json(keyfile, password_bytes))
File "eth_keyfile/keyfile.py", line 49, in decode_keyfile_json
return _decode_keyfile_json_v3(keyfile_json, password)
File "eth_keyfile/keyfile.py", line 170, in _decode_keyfile_json_v3
raise ValueError("MAC mismatch")
ValueError: MAC mismatch
>>>
It's common for command line tools to not print anything when you type in a password. Even though you think nothing is being entered, it's recording your keystrokes. Make a fresh account with a simple password and you'll see this is the case.
Well that's fancy and it worked! Thank you!
anybody encounter errors on "cytools not installed"
What OS are you installing on?
Win 10; pip install solved; thanks!
Hey man, when I get to the
>>> user = accounts.load('test_account')
Enter password for "test_account":
>>>
Phase I originally had just hit enter when asked for a password because it didn't allow me to type for some reason. And once again when I get to this part it doesn't allow me to type only hit enter to get "Value Error: MAC mismatch". Any idea what's going on here?
Also if I try and just create a new user I get
FileExistsError: Account with this identifier already exists
For clarity I think my main problem is that I just can't type when it asks me
Enter the password to encrypt this account with:
I suspect that the invisible password prompt jumbled you up, and you have a password set that you didn't intend. I recommend deleting the account with 'brownie accounts delete test_account' and starting over.
Oh wow did not now the password typed invisibly. That was incredibly frustrating haha. Surprised more people haven't got stuck on this. Thanks!
Awesome Substack you've got going btw!
You're welcome! I've made plenty of similar errors along the way, happens to the best of us.
Hi. Question: Better to dedicate a laptop or rent a small and cheap server (can be up and running 24/24)?
I run the main bot on a cloud VPS, but do my testing and experimental stuff on a local workstation. Brownie is pretty lightweight, so you don't need powerful hardware. Latency & uptime are far more important.
Thanks
I don't have a Mac so I'm flying blind a bit here, but maybe I can help. What brownie version did you install, and did you do it using anaconda or pip? Does a bare 'brownie console' work without the network option?
Hey, i'm having the same problem. I have tried everything. I have gotten to the same point this person has also gotten to, and I'm getting the same error. My brownie version is v1.16.4, and I have tried to update that as well with pipx, also to no avail. I'm pretty green to coding and using the terminal, if you can't already tell lol.
I did see he resolved the issue by deleting unused files but I really don't know what files that are on my system that would cause this error?
Please share the details of your install, including operating system and the process you used to install the packages up to this point
Im on MacOS using vscode, and I used pip to install brownie. I also tried to do it with pipx after I was having problems but it didn't do anything. I can't seem to update brownie to the latest version. I'm getting the exact same error as this guy. I am also on M1 cpu if that means anything, I know that has made things screwy with other things since it's new. I'm just lost because I can't find anything on the internet about this error, I checked if I have all the right stuff downloaded and I do(I think).
I can help with the version at least. Try again with 'pip install eth-brownie==1.18.1' which will upgrade to the latest available version. I'll do some searching to uncover that hardhat error
Fantastic! I was trying to discover what Solidity contracts brownie was pre-installing through pip, assuming you were doing this from scratch. If you'd used solc before perhaps it created a stale cache that solc couldn't handle when brownie called it at console startup.
Yes, you can do that with "brownie accounts password {name}"
There's hope if you still have the seed phrase, which you can use to recreate the private key. If you've lost that too, the account is probably toast.