Skip to content
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

Add Faucet for Swanky Node #60

Closed
3 of 6 tasks
andabak opened this issue Dec 22, 2022 · 6 comments · Fixed by #192 or #205
Closed
3 of 6 tasks

Add Faucet for Swanky Node #60

andabak opened this issue Dec 22, 2022 · 6 comments · Fixed by #192 or #205
Assignees
Labels
enhancement New feature or request

Comments

@andabak
Copy link
Collaborator

andabak commented Dec 22, 2022

Overview (What and Why)

Newly created accounts do not have any funding. There should be a feature/command to add some funds to new accounts from the Faucet.

How?

  • For swanky node, automatically transfer an amount of tokens from Alice account
  • Add address of a faucet contract to the network config
  • add swanky account subcommand to call the faucet contract (in case of swanky node, just transfer more from Alice)

Acceptance Criteria

  • Network config supports faucet contract address
  • swanky accounts has a faucet subcommand
  • changes merged

Open Issues and Blockers

@andabak andabak converted this from a draft issue Dec 22, 2022
@andabak andabak added the enhancement New feature or request label Dec 22, 2022
@codespool codespool moved this from 💡 New/Idea to 📋 Backlog (Commited) in Swanky Suite (legacy - moved to swankyhub) Jan 9, 2023
@shunsukew
Copy link
Contributor

shunsukew commented Jan 23, 2023

I can imagine faucet precompiled contracts and account subcommand invoke faucet tx (by alice because your newly created account doesn't have gas to invoke faucet tx). But why not just transfer some tokens from alice to your account?

@codespool
Copy link
Collaborator

for local yes (see the first checkbox), but if using a live node, we prob. don't have access to unlimited funds, and need to define a faucet contract address to request a drip

@shunsukew
Copy link
Contributor

shunsukew commented Feb 1, 2023

For live networks, having faucet contract address in swanky config doesn't work.
Who initiates faucet transactions? It is neither the receiver address (because it has 0 balance, cannot send transaction) nor swanky-cli default address (i.e. Alice) (because it's token with real value and giving everyone privatekey/access to that account simply doesn't work). It is manager account who holds faucet tokens.

checkbox 2,3 are not possible unless you prepare at least 1 account with enough funds whose private keys are not shared with others beforehand.
(I'd say again why not just transfer some token in live network)

So, you need external programs which can control that faucet manager account, and swanky-cli need to communicate with it via API. Here're 2 considerations.

  1. swanky-cli requires external programs and they're being hosted somewhere to satisfy its functionality.
  2. faucet program API will differ in each networks (swanky-cli is for chains which support pallet-contracts).

For these reasons, this cannot be a core feature of swanky-cli and not its responsibility, it should be plugin (specifically for Astar related chains) at least.

Being able to receive tokens with 0 balance account, that's the requirement.

@codespool
Copy link
Collaborator

I believe that by the second checkbox I imagined what you wrote in 1st point.
For example, Solana's CLI allows you to do:

solana airdrop 1 RECIEVER_ADDRESS --url https://solfaucet.com/

@codespool codespool removed this from the Swanky Winter Wonderland (v1.1.0) milestone Feb 24, 2023
@codespool codespool moved this from 📋 Backlog (Commited) to 💡 New/Idea in Swanky Suite (legacy - moved to swankyhub) Feb 24, 2023
@shunsukew
Copy link
Contributor

I see, in the case of live networks including Shinuya, it could be possible calling API server hosted somewhere.

@codespool codespool moved this from 💡 New/Idea to Proposed by Astar in Swanky Suite (legacy - moved to swankyhub) Jul 5, 2023
@codespool codespool added this to the Grant proposal roadmap milestone Jul 5, 2023
@TtomaS7 TtomaS7 moved this from Proposed by Astar to 🏗 In progress in Treasury Proposal Roadmap - ink!DevHub 1.0 Nov 13, 2023
@vsofiya vsofiya moved this from 🏗 In progress to 🛠 Ready for review in Treasury Proposal Roadmap - ink!DevHub 1.0 Nov 15, 2023
@prxgr4mm3r prxgr4mm3r linked a pull request Nov 17, 2023 that will close this issue
@TtomaS7 TtomaS7 moved this from 🛠 Ready for review to Proposed by Astar in Treasury Proposal Roadmap - ink!DevHub 1.0 Nov 20, 2023
@ipapandinas
Copy link
Contributor

The command should only work on local, and use Alice to transfer funds to the account for now.

@vsofiya vsofiya moved this from Proposed by Astar to 🛠 Ready for review in Treasury Proposal Roadmap - ink!DevHub 1.0 Jan 29, 2024
ipapandinas added a commit that referenced this issue Feb 12, 2024
@pmikolajczyk41 pmikolajczyk41 moved this from 🛠 Ready for review to Accepted in Treasury Proposal Roadmap - ink!DevHub 1.0 Feb 22, 2024
ipapandinas added a commit that referenced this issue Mar 25, 2024
ipapandinas added a commit that referenced this issue Mar 25, 2024
@ipapandinas ipapandinas moved this from Accepted to ✅ Done in Treasury Proposal Roadmap - ink!DevHub 1.0 Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment