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.
Prerequisites
To build Alphabill CLI wallet binary, you must have the following build dependencies installed on your system:
- Go (version 1.22 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
-
By default,
git clone
checks out themain
development branch. To work with the public testnet, use version0.4.0
of the code. Create a new branch from thev0.4.0
tag and switch to that branch:cd alphabill-wallet
git checkout -b 0.4.0 tags/v0.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:cd build
./abwallet wallet createThis 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
. -
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
-
List public keys you just created using the
wallet get-pubkeys
command:./abwallet wallet get-pubkeys
Example response:
#1 0x029871a8fbc1844d41ddd7cf0ceb292dbe33b8c29694c9675d13f8926f5deeb00b
#2 0x03ddeb805aba6bb56b5f6351d51f44d11a374070032f95be5841e9b6420099a00aMake a note of it, including the
0x
prefix, as you will need it in later steps.
Step 3: Get Testnet ALPHA
After setting up your wallet, you can request testnet ALPHA and fungible tokens from the testnet faucet in the Alphabill Discord server. For each request, the faucet transfers 100 ALPHA and 100 fungible tokens (TEST-FT) to the given address, with a default limit of 5 requests per day per address.
-
If you haven't joined the Alphabill Discord server yet, join now using the invite link: https://discord.com/invite/dcFURChe86
Open the #testnet-faucet channel and paste your public key into the chat window:
-
Once the faucet bot has confirmed your request, check your wallet to verify you have received 100 ALPHA and 100 TEST-FT tokens:
-
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 Credit
Before you can make any transaction from your wallet, you need to have enough funds on your fee credit balance to pay for the cost of transactions and data storage on the blockchain. Each wallet account has its own fee credit balance for every partition.
Transaction fees are paid in Alphabill's native currency, ALPHA, and the fee per transaction is 0.000'000'01 ALPHA (that is, 1 tema). Actions that consist of three transactions (3 x 0.000'000'01 ALPHA) are: updating fee credit record, reclaiming fee credit, 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
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
-
Step 5: Transfer Assets
-
Transfer a bill worth of 10 ALPHA to your second account:
./abwallet wallet send \
--address 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 learn how to use the CLI wallet to create, mint and transfer your own fungible and non-fungible tokens.
- Learn how to use the Money Partition capabilities to make payments from one wallet to another, manage bills in your wallet, and swap smaller bills into one larger bill.