Skip to content
Discussion options

You must be logged in to vote

Hi,
So i change my code for connecting to ganache like that.

# for connecting to ganache
w3 = Web3(Web3.HTTPProvider("http://127.0.0.1:7545"))
w3.eth.chain_id
1377
w3.net.version
"5777"
my_adress = "0x254eFA185DF460A57d957855656260b60308D1e7"
private_key = os.getenv("PRIVATE_KEY")

and now i get an error on output ( i tried to add a varible name chain_id = "5777" )

line 65, in <module>    {"chainID": chain_id, "from": my_adress, "nonce": nonce}
NameError: name 'chain_id' is not defined

I'm not comfortable yet with the notion of chain_id
the chain_id is like the id of one block on the blockchain ?
And network id is the id of the blockchain ?
to make a test with ganache where can i find th…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@n4n0b1t3
Comment options

Answer selected by wilonweb
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants