Adding Gasless Counter tutorial using Tabookey Gas Stations Network. #6
Conversation
…migrations contract
I have added the full tutorial with upgradability and access control. I have written a draft article to be published once this PR is merged: https://medium.com/@kylebryant_28277/introducing-tabookeys-gas-station-network-in-zeppelin-s-zepkit-4d189d43b5f1 |
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.
Thanks @Kyrrui! I added several comments. As discussed over the phone, prioritize them as you see fit, and tackle the ones you think are most important given the time left.
Also, I'll be uploading the logs from my machine in a few minutes, so you can try to reproduce the error I'm getting when sending a relayed tx.
</div> | ||
<div className={styles.code}> | ||
<code> | ||
npm explore tabookey-gasless npm run gsn-dock-relay-ganache |
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.
The first time I went through the tutorial, I had run this command and gone ahead with the others (since it took several minutes to complete, until the docker image was downloaded). And since I had a ganache running from the previous tutorial, most commands just worked (including the truffle migrate).
Would it be possible to validate that the user is indeed connecting to the gsn ganache, maybe by checking that the relayer hub is deployed to the current network, and alert the user if they are not? I think this would help prevent several issues.
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.
I will def look into this, as others will probably run into this same issue.
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.
What do you think of just adding a step to kill any processes running at port 8545 before running the docker container. ie
npx kill-port 8545 & npm explore tabookey-gasless npm run gsn-dock-relay-ganache
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.
Seems like an easy fix, I like it!
When clicking on the Increase Counter button, after selecting Use Relayer, I'm getting the following error on the Chrome console:
The gsn docker logs show the following:
Let me know if I can provide any further info! |
@Kyrrui I ran the tutorial on a fresh clone of the repo, and the relayed transaction did go through this time and increased the Counter. However, after the tx is sent, I'm getting the following error in the console:
The only error I see on the relayer logs is an "Invalid JSON []":
Let me know if I can provide any further info! |
Looking into this, not sure if I can find a solution without hacking around the https://github.com/tabookey/tabookey-gasless/blob/master/server/src/RelayHttpServer.go Seems like an error is being caught during this line |
Let's open an issue in that repo then, so they are aware of the problem! |
|
Thanks for the updates @Kyrrui, looks much better now! One last suggestion: on Attempt to increse the counter, you will notice the transactions fails as your address is not on the whitelist., the page provides no feedback at all of what happened. It may be useful to catch the error and show any kind of message to the user notifying them of the failure. Besides that, I think we can wrap up this PR! |
Just added the message and resolved conflicts! It should be ready to merge |
Implemented as GSN Starter Kit. |
This is the base tutorial for a Gasless Counter tutorial.
For now I have not included any links to the tutorial on the main page of the dapp, to access it you must navigate to localhost:3000/gasless-counter. The tutorial instructs the user to do 3 things:
The user can then use the dapp by signing transactions instead of paying for them.
I would like to extend the tutorial further to include setting up a simple access control model (a whitelist) of accounts that can use the relayer. This extension can also serve to show upgradability.