Get Started with CLI Wallet
This quick start guide covers basic steps you need to set up Alphabill command-line interface (CLI) wallet, get testnet assets in your wallet, and make a transaction from your wallet on public Alphabill testnet.
If you have already set up CLI wallet, you can skip the first two steps and start from step 3.
Prerequisites
To build Alphabill CLI wallet binary, you must have following build dependencies installed on your system:
- Go (version 1.21 and later). For installation instructions, see Go's installation guide.
- C compiler, recent versions of GCC are recommended. In Debian and Ubuntu repositories, GCC is part of the
build-essential
package. If you are on macOS, you can install GCC with Homebrew.
Step 1: Build Alphabill CLI Wallet Binary
-
Clone the remote
alphabill-wallet
repository:git clone https://github.com/alphabill-org/alphabill-wallet.git
ImportantYou need to make sure the version of the wallet is compatible with the version of the service you will connect to.
To work with the public testnet, use the
0.4.0
branch of the code:cd alphabill-wallet
git checkout -t origin/0.4.0 -
Once you have cloned the repository and checked out the desired branch, run the
make build
command in the newalphabill-wallet
directory:make build
This command will download all necessary build dependencies, run the tests, and build the
abwallet
binary. The output directory for the binary isalphabill-wallet/build
.
Step 2: Create a New Wallet
-
To create a new wallet, go to the
alphabill-wallet/build
directory and run thewallet create
command:./abwallet wallet create
This command returns mnemonic key you can use to recover your wallet. The mnemonic key, also known as a recovery phrase or a seed phrase, is a unique 12-word phrase that is generated when you create a new wallet. This phrase is the key to your wallet and controls access to all your funds.
warningWrite down the phrase in the exact order in which you receive it, and keep it in a safe, offline place. You will only see this phrase once during the wallet creation. Never give your wallet's seed phrase to anyone, as it can be used to steal your wallet funds.
The
wallet create
command creates a database for keys that will be used by the wallet, located at~/.alphabill/wallet/accounts.db
. -
List the wallet public key you just created using the
wallet get-pubkeys
command:./abwallet wallet get-pubkeys
Example response:
#1 0x029871a8fbc1844d41ddd7cf0ceb292dbe33b8c29694c9675d13f8926f5deeb00b
Make a note of it, including the
0x
prefix, as you will need it in later steps. -
Also add a second public key to your wallet, as you need it later when transferring testnet ALPHA:
./abwallet wallet add-key
Example response:
Added key #2 0x03ddeb805aba6bb56b5f6351d51f44d11a374070032f95be5841e9b6420099a00a
Step 3: Request Testnet Assets
Once you have set up your wallet, you can request testnet assets from the faucet by using Alphabill Discord channel. The faucet distributes a standard amount of testnet ALPHA and fungible tokens to a specific address. If you haven't yet signed up for Alphabill Discord, then join now using the invite link.
-
Go to the #testnet-faucet channel, paste your wallet public key address into the channel's chat window, and press Enter.
-
You will get automatic replies to your message as "Bills sent!" and "Tokens sent!".
infoFor each request, the faucet transfers 100 ALPHA and 100 TEST-FT tokens to the given address. The testnet faucet imposes a maximum number of requests for a period of time. By default, the faucet service accepts 5 requests per day per address.
-
In a matter of seconds, you should see 100 ALPHA and 100 TEST-FT tokens on your wallet balance.
-
Check your wallet balance:
./abwallet wallet get-balance \
--rpc-url https://money-partition.testnet.alphabill.orgExample response:
#1 100.000'000'00
#2 0.000'000'00
Total 100.000'000'00 -
List tokens in your wallet:
./abwallet wallet token list \
--rpc-url https://tokens-partition.testnet.alphabill.orgExample response:
Tokens owned by account #1
ID='4BBD81AB755A26741C19C1AAB54B61031D5FC5C1E7A053521D94B3421DE243D8', symbol='TEST-FT', amount='100.000'000', token-type='DE4EE474E513FFACAC81D0141CF334A1DDFD366340E0D4F619DD4266895A25FD' locked='' (fungible)
Tokens owned by account #2
-
Step 4: Add Fee Credits
Before you can make any transaction from your wallet, you need to have enough funds on your fee credit balance to cover the associated transaction costs. Each wallet account (public key) has its own fee credit balance for every partition.
Transaction fees are paid in Alphabill native currency ALPHA, and the fee per transaction is 0.000'000'01 ALPHA. Actions that consist of two transactions (2 x 0.000'000'01 ALPHA) are: adding fee credits, reclaiming fee credits, and consolidating bills.
-
Add 1 ALPHA to your fee credit balance for managing fees on Money Partition:
./abwallet wallet fees add \
--rpc-url https://money-partition.testnet.alphabill.org \
--log-file ~/.alphabill/wallet.logExample response:
Successfully created 1 fee credits on money partition.
Paid 0.000'000'02 ALPHA fee for transactions.If you want to add 1 ALPHA to other partition's fee credit balance, specify the partition name and its URL:
-
User Token Partition
./abwallet wallet fees add \
--rpc-url https://money-partition.testnet.alphabill.org \
--partition tokens \
--partition-rpc-url https://tokens-partition.testnet.alphabill.org \
--log-file ~/.alphabill/wallet.log -
EVM Partition
./abwallet wallet fees add \
--rpc-url https://money-partition.testnet.alphabill.org \
--partition evm \
--partition-rpc-url https://evm-partition.testnet.alphabill.org \
--log-file ~/.alphabill/wallet.log
tipIf you want to add more funds to the fee credit balance than the default 1 ALPHA, use the
--amount
flag at the end of the command and specify the amount. -
-
Check your wallet fee credit balance on Money Partition:
./abwallet wallet fees list \
--rpc-url https://money-partition.testnet.alphabill.orgExample response:
Partition: money
Account #1 0.999'999'98
Account #2 0.000'000'00To check the fee credit balance on other partitions:
-
User Token Partition
./abwallet wallet fees list \
--rpc-url https://money-partition.testnet.alphabill.org \
--partition tokens \
--partition-rpc-url https://tokens-partition.testnet.alphabill.org -
EVM Partition
./abwallet wallet fees list \
--rpc-url https://money-partition.testnet.alphabill.org \
--partition evm \
--partition-rpc-url https://evm-partition.testnet.alphabill.org
-
Step 5: Transfer Assets
-
Transfer a bill worth of 10 ALPHA to your second account:
./abwallet wallet send \
--address INSERT_YOUR_WALLET_PUBKEY_#2 \
--rpc-url https://money-partition.testnet.alphabill.org \
--amount 10 \
--log-file ~/.alphabill/wallet.logYou should see similar output like in the example below:
Example response:
Successfully confirmed transaction(s)
Paid 0.000'000'01 fees for transaction(s). -
Finally, check your wallet balance:
./abwallet wallet get-balance \
--rpc-url https://money-partition.testnet.alphabill.orgExample response:
#1 89.000'000'00
#2 10.000'000'00
Total 99.000'000'00
Next Steps
- Check out the User Token Partition tutorials to create, mint and transfer your own fungible and non-fungible tokens using CLI wallet.
- The EVM Partition tutorial shows you how to deploy and execute smart contracts implemented in Solidity on Alphabill EVM Partition using the CLI wallet.