-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update examples.rst with Infura/rinkeby steps #1444
Conversation
Note that this example would have to be updated for v5. It's using v4 things, like |
feel free to add edit ( if you can ) or you can simply suggest them to me thanks ! |
@SyedMuhamadYasir Looks like the two failures are just flaky tests, so don't worry about those. I'm happy to update if you want, just let me know! |
thanks for reassuring me on those tests yeah, go ahead ! P.S : should i update the stuff in this pull request before you make the changes ? |
@SyedMuhamadYasir please go ahead and update if you have the time, thank you! |
done ! please take a look :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 this is looking good! I just ran through the actual commands locally and added a few more comments. Thank you!
all recommended changes applied, kindly check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me @SyedMuhamadYasir! Thank you!
Great 😄 any further steps i have to take to complete my contribution ? |
If you're feeling up to it, it would be helpful if you could make a new file called |
Thank you @SyedMuhamadYasir! |
You are most welcome @kclowes ! and thank you for helping me out with the process ! i'll be working with Ethereum (and web3.py) in the time to come and i hope to make more contributions to the repo see you ^_^ |
Using Infura Rinkeby Node
Import your required libraries
Initialize a web3 instance with an Infura node
Inject the middleware into the middleware onion
Just remember that you have to sign all transactions locally, as infura does not handle any keys from your wallet
P,S : the two updates are done to the transaction dictionary, since it might not contain gas & nonce amounts, so you have to add them manually.
And then send the transaction
What was wrong?
Related to Issue # ; not sure about which issue this might correspond to, but there was terrible documentation regarding how to inject the POA middleware and calling a state-changing transaction also yielded alot of errors in my experimentation. so i thought to contribute a combined solution, outlining the simple yet subtle step of injecting middle-ware and also how to constuct a raw transaction to interact with a state-changing function in your smart contract.
How was it fixed?
It can be seen in the code. However, to put it briefly, i just simplified the steps on injecting the geth-style middleware in web3.py, when using an Infura Rinkeby node and i also outlined the steps on how to properly construct a transaction for calling a state-changing function in a smart-contract deployed on Rinkeby testnet.
Todo:
Cute Animal Picture