In Part 1 we covered the AVA Wallet. We discovered how to install the wallet, how to run the wallet, and a brief tour of using the wallet Dapp. In this section of the three-part series, we discuss the AVA Faucet and put funds into an AVA Wallet.
AVA comes with a faucet application which can serve AVA from a test network to an address of our choosing. It’s a Node.js application which enables users to obtain test AVA tokens. All transactions are sent from a known private key that has AVA tokens in it already. Once those tokens run out, we’ll need to refill that address. It’s highly recommended to only use this on test networks, otherwise real AVA will be given to whomever finds the faucet.
The AVA Faucet installation assumes we’ve installed Node.js 12.14.1 and have the `npm` tool on a local machine.
git clone https://github.com/ava-labs/faucet-site.git
cp .env.example .env
In preparation we’ll need to get a reCaptcha secret key for the faucet. The address to get this is https://www.google.com/recaptcha/admin/create.
We need a v2 reCaptcha with the following options:
Now that the code is installed, let’s set up a local environment by editing the “.env” file we just created. We’re going to assume that the following values are for the local network tutorial, but of course we can modify these values to taste.
AVA_IP — The IP Address of the AVA node. Try: “localhost”
AVA_PORT — The port of the AVA node. Try: 9650
AVA_PROTOCOL — Either http or https. Try: “http”
AVA_NETWORK_ID — The NetworkID of the AVA node. Try: 12345
AVA_CHAIN_ID — The BlockchainID of the AVM. Try: “X”
CAPTCHA_SECRET — A captcha secret from Google reCaptcha (https://www.google.com/recaptcha/admin/create)
VUE_APP_CAPTCHA_SITE_KEY — A public site captcha key from Google reCaptcha
ASSET_ID — Which asset id is the official AVA Token. Try: “AVA”
PRIVATE_KEY — A private key with funds in it. Try: “ewoqjP7PxY4yr3iLTpLisriqt94hdyDFNgchSxGGztUrTXtNN”
DROP_SIZE — How much nanoAvas is given from this faucet. Try: 25 for 25 nanoAVA
Now that the wallet code is installed and configured, we can run it by:
npm run serve
If this is configured correctly we should see:
Navigate to https://localhost:8081 and if all goes well we will see:
Using the Faucet
The AVA Wallet address we just created needs some tokens. Let’s send ourselves some!
Hit “Request ## $AVA” and we should see a success message:
And the balance should update in the wallet Dapp very shortly! Hit the refresh button and the new balance will appear.
And as we can see the balance updated. A $nAVA (nanoAVA) is the smallest unit of AVA possible. For a full unit of AVA, we have to multiply the value in the DROP_SIZE configuration variable by 10⁹. So to send 25 $AVA, the DROP_SIZE should be 25000000000.
Exchanging assets, seeing them in a wallet, sending them to others… that’s great but how do we build Dapps?
Join AVA’s social channels to stay up-to-date with our progress.
- Website: https://avalabs.org/
- Whitepaper: https://arxiv.org/pdf/1906.08936.pdf
- Twitter: https://twitter.com/avalabsofficial
- Discord (devs): https://discord.gg/ccc8vEP
- GitHub Repo: https://github.com/ava-labs/gecko
- Documentation: https://docs.ava.network/
- Developer Accelerator Program: http://avalabs.org/dap
- Telegram: https://t.me/avacoin_official
- Telegram announcement: https://t.me/AVA_announcements
- Linkedin: https://www.linkedin.com/company/ava-labs
- Reddit: https://www.reddit.com/r/ava
- Medium: https://medium.com/avalabs
- Facebook: https://www.facebook.com/AvaLabsOfficial
- Youtube: http://www.youtube.com/c/AVAofficial