Skip to main content

7. Use abectl (wallet control console) to Operate abewallet

In the abec folder, there is another executable called start_abectl.sh (macOS and Linux) or abectl (Windows). This executable can be used for checking the balance of your wallet, make fund transfer, and so on.

7.1 Check balance

Run the following to check the balance of your wallet where username and password should be the same as the options rpcuser and rpcpass we configured in abewallet.conf, respecitvely.

# macOS and Linux
./start_abectl.sh --rpcuser=[username] --rpcpass=[password] --wallet getbalancesabe
# Windows
abectl --rpcuser=[username] --rpcpass=[password] --wallet getbalancesabe

Example:

./start_abectl.sh --rpcuser=abewalletrpcuser --rpcpass=abewalletrpcpass --wallet getbalancesabe
{"current_time":"2022-05-26 23:08:07.730291 +0800 HKT m=+10.601777429","current_height":12051,"current_block_hash":"00000000734e4c08b4422954da4df52c42fa1b3466e340ac332ad037f9a15ad5","total_balance":103424,"spendable_balance":102400,"freeze_balance":1024}

7.1.2 If Abectl and Abewallet are on different machines

When running abectl, we need to specify the IP address and port of the remote abewallet. To do so, we use parameter --rpcserver=[IP:PORT].

To get the RPC certificate of the remote abewallet, you need to copy the file rpc.cert from the configuration folder of abewallet, and paste it in any place in the machine which runs abectl, and add parameter --rpccert=[location of cert] while running abectl.

# macOS and Linux
./start_abectl.sh --rpcuser=[username] --rpcpass=[password] --rpcserver=[IP:PORT] --rpccert=[location of cert] --wallet getbalancesabe
# Windows
abectl --rpcuser=[username] --rpcpass=[password] --rpcserver=[IP:PORT] --rpccert=[location of cert] --wallet getbalancesabe

Example:

./start_abectl.sh --rpcuser=abewalletrpcuser --rpcpass=abewalletrpcpass --rpcserver=192.168.1.3:8665 --rpccert=/home/username/rpc.cert --wallet getbalancesabe
{"current_time":"2022-05-26 23:08:07.730291 +0800 HKT m=+10.601777429","current_height":12051,"current_block_hash":"00000000734e4c08b4422954da4df52c42fa1b3466e340ac332ad037f9a15ad5","total_balance":103424,"spendable_balance":102400,"freeze_balance":1024}

7.2 Unlock

Before you send transactions or generate a new address, you should unlock the wallet first.

# macOS and Linux
./start_abectl.sh --rpcuser=[rpc username] --rpcpass=[rpc password] --wallet unlockwallet [private passphrase] [timeout]
# Windows
abectl --rpcuser=[rpc username] --rpcpass=[rpc password] --wallet unlockwallet [private passphrase] [timeout]

NOTE: The unit of timeout is in seconds.

Example:

./start_abectl.sh --rpcuser=abewalletrpcuser --rpcpass=abewalletrpcpass --wallet unlockwallet 123456 240

This means unlock the wallet with passphrase 123456 for 240 seconds.

7.3 Generate a new address

To generate a new address (for receiving ABEL tokens)

# macOS and Linux
./start_abectl.sh --rpcuser=[rpcuser] --rpcpass=[rpcpass] --wallet generateaddressabe
# Windows
abectl --rpcuser=[rpcuser] --rpcpass=[rpcpass] --wallet generateaddressabe

7.4 Recover a wallet

If you want to recover a wallet, delete logs/ and mainnet/ folders in the configuration folder of Abewallet, then run

# macOS and Linux
./start_abewallet.sh --create
# Windows
abewallet --create

Example:

$ ./start_abewallet.sh --create
Enter the private passphrase for your new wallet:
Confirm passphrase:
Enter the public passphrase for your new wallet:
Confirm passphrase:
NOTE: Use the --walletpass option to configure your public passphrase.
Do you have an existing wallet seed you want to use? (n/no/y/yes) [no]: y
Enter the crypto version is:0
Enter existing wallet mnemonic: biology,hazard,sudden,dignity,drop,jealous,butter,believe,answer,enter,practice,scorpion,health,tunnel,rival,vault,neutral,season,proof,must,path,steel,final,female
Please input the max No. of address to recover :5
Creating the wallet...
2022-05-07 19:55:01.548 [INF] WLLT: The addresses with No. in [0, 5] have been restored.
2022-05-07 19:55:02.282 [INF] WLLT: Opened wallet
The wallet has been created successfully.

Note: The max No. of address to recover is the number of times that the wallet has been recovered.