Skip to content

Aion4j Faucet and Test Account Management Support

Satya edited this page Aug 22, 2019 · 5 revisions

(Supported in version: 0.7.2 and above)

Aion4j Faucet support helps developers to get Aion Testnet tokens (currently Mastery) directly from Aion4j Maven Plugin. It also provides account management support for test accounts. This could be useful for developers to manage their test accounts at one place.

Pre-requisites

  1. Set web3rpc_url environment variable. Alternatively, you can set it under configuration section in pom.xml under "remote" profile.
$> export web3rpc_url=https://aion.api.nodesmith.io/v1/mastery/jsonrpc?apiKey=xxxxxxx

If you are setting it in pom.xml's remote profile section, you need to pass -Premote to use remote profile during maven command invocation.

Commands

The aion4j:account goal provides support for account specific operations.

Usage:

$> mvn aion4j:account -D<command> [-D<command> ...]
  • To create a new account and show private key
$> mvn aion4j:account -Dcreate
  • To create a new account and top-up with testnet tokens

The following command will create a new account and top-up the account with some testnet tokens. You can later top-up this account with additional Aion coins. But there is a limit (currently max 3 times) for how many times an account can request for top-up in a day.

$> mvn aion4j:account -Dcreate -Dtopup
  • To top-up an existing account

You need to pass both account address and privatekey in the following command.

$>  mvn aion4j:account -Dtopup -Daddress=0xa0xxxxxxxx  -Dpk=xxxxxxxxxxxxxx
  • List all test accounts and their private keys
$> mvn aion4j:account -Dlist
  • List all test accounts with address and private key. Also fetch the balance
$> mvn aion4j:account -Dlist-with-balance
  • Clear all test accounts

This command removes all test accounts from local cache. The list command after clear does not return anything.

$> mvn aion4j:account -Dlist-clear