56 Comments

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

Expand full comment
author

Thanks! I've added that code block to the post above and credited you.

Expand full comment
Jan 31, 2022Liked by BowTiedDevil

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!!!

Expand full comment
Jul 8, 2022Liked by BowTiedDevil

Awesome walkthrough, thanks

Expand full comment
Feb 17, 2022Liked by BowTiedDevil

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

Expand full comment
author

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.

Expand full comment
Jan 4, 2022Liked by BowTiedDevil

catching up... really good stuff, thanks Devil

Expand full comment
Dec 24, 2021Liked by BowTiedDevil

Is there a way to change the account password in brownie? can't seem to find how to do this in the eth-brownie documentation

Expand full comment
author

Yes, you can do that with "brownie accounts password {name}"

Expand full comment

thank you. guess what i should have asked is if there is a way to reset an unknown/lost password? must have fat fingered the original password when generating the account.

Expand full comment
author

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.

Expand full comment

no worries, i do have the seed phrase. but, i'll just create a new account.

Expand full comment

Went thru this exercise without a hitch. Thanks Devil!

Expand full comment

Was able to replicate everything here. However, kept getting getting this message, but it didn't seem to affect anything. INFO: Could not find files for the given pattern(s).

Expand full comment
author

What brownie version are you using and on which platform? I'll try to see if I can replicate the message.

Expand full comment

brownie 1.17.2 on windows

Expand full comment

fyi I got the same when I setup VS & Brownie a week or two ago

saw some fixes on google but didn't bother, they said it didn't affect functionality so only worth worrying about if it's really annoying you

Expand full comment

"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

Expand full comment
author

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

Expand full comment

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...

Expand full comment
author

As long as the venv is active, the prompt is irrelevant. Does Brownie work otherwise?

Expand full comment

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.

Expand full comment
author

Should have been "relies on", I fixed the post 👍

Expand full comment

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.

Expand full comment
author

All good, when you find mistakes I'm glad to fix them and improve all of these lessons regardless of age.

Expand full comment

note to self: activate venv on Windows using the Command Prompt: path\to\venv\Scripts\activate.bat

Expand full comment

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

Expand full comment
author

What distro are you running? If it's Debian based, 'apt install python3-dev' tends to fix a lot of weird issues.

Expand full comment

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...

Expand full comment

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

>>>

Expand full comment
author

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.

Expand full comment
Feb 24, 2022Liked by BowTiedDevil

Well that's fancy and it worked! Thank you!

Expand full comment

anybody encounter errors on "cytools not installed"

Expand full comment
author

What OS are you installing on?

Expand full comment
Feb 1, 2022Liked by BowTiedDevil

Win 10; pip install solved; thanks!

Expand full comment

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?

Expand full comment

Also if I try and just create a new user I get

FileExistsError: Account with this identifier already exists

Expand full comment

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:

Expand full comment
author

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.

Expand full comment
Jan 4, 2022Liked by BowTiedDevil

Oh wow did not now the password typed invisibly. That was incredibly frustrating haha. Surprised more people haven't got stuck on this. Thanks!

Expand full comment
Jan 4, 2022Liked by BowTiedDevil

Awesome Substack you've got going btw!

Expand full comment
author

You're welcome! I've made plenty of similar errors along the way, happens to the best of us.

Expand full comment

Hi. Question: Better to dedicate a laptop or rent a small and cheap server (can be up and running 24/24)?

Expand full comment
author

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.

Expand full comment