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 added the enhancement New feature or request label Dec 22, 2022
@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
@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 added this to the Grant proposal roadmap milestone Jul 5, 2023
@prxgr4mm3r prxgr4mm3r linked a pull request Nov 17, 2023 that will close this issue
@ipapandinas
Copy link
Contributor

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

ipapandinas added a commit that referenced this issue Feb 12, 2024
Co-authored-by: Igor Papandinas <igor.papandinas@posteo.net>
ipapandinas added a commit that referenced this issue Mar 25, 2024
Co-authored-by: Igor Papandinas <igor.papandinas@posteo.net>
ipapandinas added a commit that referenced this issue Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment