TUTORIAL: How to Get Testnet Funds?
In this tutorial we'll briefly explain æternity testnets – what they are, what they're used for, and how to get AE tokens from a faucet for testnets.
- Please read our previous tutorial How to Create an æternity Account With CLI? in order to better understand the next steps and to follow them.
æternity test networks
Testnets are copies of the æternity blockchain almost identical to the live network except the fact that their AE tokens are worthless.
The æternity SDK team currently runs three testnets - sdk-testnet, sdk-edgenet and uat-testnet. Testnet is the latest stable release, and Edgenet is the next. The æternity core team runs another network, uat-testnet. It’s for internal testing and is not guaranteed to work with the SDKs. But it’s the one which has the very latest features and may be useful for you if you are an enthusiast who runs their own nodes.
In the previous tutorial we've installed aecli. So we can use
aecli chain to interact with the blockchain. You can see additional information for the command here:
Options: -u --url [hostname] Node to connect to (default: "https://sdk-mainnet.aepps.com") --internalUrl [internal] Node to connect to(internal) (default: "https://sdk-mainnet.aepps.com") --networkId [networkId] Network id (default: ae_mainnet) -L --limit [playlimit] Limit for play command (default: 10) -P --height [playToHeight] Play to selected height -f --force Ignore epoch version compatibility check --json Print result in json format -h, --help output usage information Commands: top Get top of Chain status Get Epoch version mempool Get mempool of Chain play Real-time block monitoring
Audience – people using released versions of our SDKs. Most software developers should use this one.
Let's check the Epoch version of sdk-testnet:
aecli chain status -u https://sdk-testnet.aepps.com
expected output at the time of writing:
Epoch node version____________ 0.25.0
Audience – people developing the SDKs, developers who need the latest features from the develop branch on github. This network is used primarily for development and can be reset without notification.
Epoch version checking:
aecli chain status -u https://sdk-edgenet.aepps.com
Epoch node version____________ 1.0.0
Audience – core developers, miners, people who want to track the bleeding edge. You may not be able to connect to this using our SDKs because it’s a version later than the ones they support.
We are going to use the secure wallet created in the previous tutorial -
Getting wallet balance:
aecli account balance <wallet_path>
Options: -u, --url [hostname] Node to connect to (default: "https://sdk-mainnet.aepps.com") -U, --internalUrl [internal] Node to connect to(internal) (default: "https://sdk-mainnet.aepps.com") --native Build transaction natively --networkId [networkId] Network id (default: ae_mainnet) -P, --password [password] Wallet Password -n, --nonce [nonce] Override the nonce that the transaction is going to be sent with -f --force Ignore epoch version compatibility check --json Print result in json format -h, --help output usage information
When checking the balance of an empty wallet, the expected output should be:
aecli account balance ./my-ae-wallet -u https://sdk-edgenet.aepps.com prompt: Enter your password: ***** API ERROR: Account not found
The account is not found, because the wallet actually has 0 funds and the balance is equal to 0.
Running the above command, but with
-u https://sdk-edgenet.aepps.com will result in the same error.
Let's change that!
There are two ways of getting tokens. The faucets operated by the SDK team will give you tokens for no effort at all. Alternatively, you can mine your own. The SDK team does not provide tokens for the uat-testnet via a faucet.
- sdk-testnet - https://faucet.aepps.com/
- sdk-edgenet - https://edge-faucet.aepps.com/
In the next steps we're going to show you how to get tokens from the faucet for sdk-edgenet. The same proces could be followed for the sdk-testnet.
The faucet form accepts just one parameter - wallet address. Let's bring to mind how to get it:
aecli account address my-ae-wallet
The CLI will prompt you to type in your password and will give you the following output:
Your address is: ak_2EdPu7gJTMZSdFntHK5864CnsRykW1GUwLGC2KeC8tjNnFBjBx
We are placing a request and just few seconds later, our account is topped up:
Added 250000000000000000000 AET! Current Balance: 250000000000000000000 Transaction: [th_24L8sJY3d2Gqqd6CTnhmCKU6Ys8AyQ7HCE8q7qouDyypzoJ3aB](https://explorer.aepps.com/#/tx/th_24L8sJY3d2Gqqd6CTnhmCKU6Ys8AyQ7HCE8q7qouDyypzoJ3aB) Account: ak_2EdPu7gJTMZSdFntHK5864CnsRykW1GUwLGC2KeC8tjNnFBjBx
Finally, let's check the balance of wallet on sdk-edgenet:
aecli account balance ./my-ae-wallet -u https://sdk-edgenet.aepps.com
and we have it:
Your balance is: 250000000000000000000
If you want to use your node to mine, please read the following documentation: Beneficiary Account and Miner Configuration
Testnets are an incredibly useful tool in æpps development. They make the process of testing the æternity software much easier by providing safety layers on which to experiment before pushing something to the live network.
The æternity team will keep this tutorial updated. If you encounter any problems please contact us through the æternity Forum.