-
Notifications
You must be signed in to change notification settings - Fork 564
feat: add cosmosfaucet #630
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
Conversation
8a63244
to
e1e84b5
Compare
e1e84b5
to
ea377ff
Compare
the faucet server runs via Starport's Dev server and it is reachable through `/faucet` endpoint. usage: ```yaml ... faucet: name: user1 ... ```
8d6d50c
to
284845d
Compare
Awesome! The faucet can only send one denom, right? I'm just thinking about UX of Currently the interface is: faucet:
name: faucet
denom: "token"
credit: 100
max_credit: 1000 This is fine, but I propose keeping the existing terminology: faucet:
name: faucet
denom: "token"
amount: 100
amount_max: 1000 If we can make it multi-token, that would be even better, of course: faucet:
name: faucet
coins: ["100token", "200foo]
coins_max: ["1000token", "2000foo"] |
Customizing the port number may be very useful as well, but we can handle this is a 8000 nother PR. |
* detect on the fly changes in config.yml to reconfigure the faucet server.
changed `config.yml` syntax as below: ```yml ... faucet: name: user1 coins: - "10token" - "5stake" coins_max: - "33token" - "20stake" ... ```
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.
utACK 👍
Great having a faucet! 🙂 I've been manually testing it, and it doesn't seem to send tokens properly. If I specify multiple coin denoms: accounts:
- name: user1
coins: ["1000token", "100000000stake"]
- name: faucet
coins: ["100000token", "100000foo"]
faucet:
name: faucet
coins: ["100token", "2foo"] It sends only If I have only accounts:
- name: user1
coins: ["1000token", "100000000stake"]
- name: faucet
coins: ["100000token", "100000foo"]
faucet:
name: faucet
coins: ["2foo"] It responds with: {"status":"error","error":"cannot send tokens (SDK code 5): failed to execute message; message index: 0: 0uatom is smaller than 10000000uatom: insufficient funds"} |
@fadeev actually with the current implementation, faucet does not transfer all the defined coins in the
How do you feel about this behavior tho? |
Thanks for making this clear for me! This behavior is somewhat confusing. I think it would be much easier to understand if |
@ilgooz This works great! One last improvement before we can merge 🙏 Can you increase the default coin max to |
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.
Woohoo! 👏 Works awesome!
* https://github.com/tendermint/starport: (94 commits) fix: change "frontend" to "vue" in gitignore (#674) feat(serve): save state as genesis when the app is stopped (#666) fix(relayer): update version (#640) feat(scaffold): upgrade Stargate to SDK v0.40.1 (#663) feat(scaffolder): init and export genesis for scaffolded types (#661) refactor(templates): rm internal/ from Stargate scaffold (#659) refactor: move Stargate app's third_party/proto into proto/third_party (#658) fix(docs): typo on custom modules feat: integrate app's protocgen script into starport (#654) fix: starport-docs-tutorials Introduction.md file (#653) fix(template:) rm dash in proto pkg names (#649) fix: add d to appname (#652) Update install info (#650) docs: update docs stargate (#648) feat: add cosmosfaucet (#630) feat: import wasm with Stargate (#642) feat: Pi for stargate (#627) feat(scaffolder): run fmt on scaffolder commands (#647) docs: added info on config (#646) feat: custom keyring-backend in config (#637) ...
* init cosmosfaucet with LP and SP compability * enable faucet in the config.yml the faucet server runs via Starport's Dev server and it is reachable through `/faucet` endpoint. usage: ```yaml ... faucet: name: user1 ... ``` * print err code * docs * fix lint * fix lint * run the faucet in a different server w/ custom port support * detect on the fly changes in config.yml to reconfigure the faucet server. * support multi denoms changed `config.yml` syntax as below: ```yml ... faucet: name: user1 coins: - "10token" - "5stake" coins_max: - "33token" - "20stake" ... ``` * fix lint * fix when max not provided for coin * add test for cosmoscoin * support transferring multi coins at once * handle client side cancel * fix
to transfer tokens from the faucet account to the requester account.
refactoring code from the original implementation: https://github.com/allinbits/cosmos-faucet.
related to #570.
the faucet server runs via Starport's Dev server and it is reachable through
/faucet
endpoint.usage:
And then make a JSON
POST
req with following payload:http://localhost:12345/faucet