NethermindEth / near-sffl

https://nffl.nethermind.io/
MIT License
7 stars 7 forks source link

Add utility for funding NEAR testnet accounts #222

Open Hyodar opened 3 months ago

Hyodar commented 3 months ago

I have a small script I used for funding the NEAR testnet accounts (added pretty much enough for quite a while) that should be added to the repository at some point in the best way possible. The idea is it creates a new account using the faucet and deletes it, transferring the funds received from the faucet to the beneficiary address. I think integrating it to some kind of CLI would be the best approach here instead of adding one more .sh around. This is the script:

#!/bin/bash

random_n=$(shuf -i 1-100000 -n 1)
unix_time=$(date +%s)
account_name="test_${unix_time}_${random_n}.testnet"
near create-account ${account_name} --useFaucet
near delete-account ${account_name} $1 --force

So you just call it e.g. ./fund_account.sh sfrelayer421614-0-2.testnet. This uses the current version of the NEAR cli.