First Transactions

Once the client connects to a node on the testnet, you will see the following output.

usage: <command> <args>

Use the following commands:

account | a
  Account operations
query | q
  Query operations
transfer | transferb | t | tb
  <sender_account_address>|<sender_account_ref_id> <receiver_account_address>|<receiver_account_ref_id> <number_of_coins> [gas_unit_price (default=0)] [max_gas_amount (default 10000)] Suffix 'b' is for blocking.
  Transfer coins from account to another.
help | h
  Prints this help
quit | q!
  Exit this client


Please, input commands:

libra%

Create x and y Account

Step 1: Check If the CLI Client Is Running on Your System

A libra% command line prompt indicates that your Libra CLI client is running. To see the help information for the account command enter “account” as shown below:

Step 2: Create Alice’s Account

Note that creating an account using the CLI does not update the blockchain, it just creates a local key-pair.

To create x account, enter this command:

libra% account create

Sample output on success:

Create y account, enter the same command:

libra% account create

Sample output on success:

Step 4 (Optional): List Accounts

To list the accounts you have created, enter this command:

libra% account list

Sample output on success:

Add # Coins to x and y Accounts

Step 1: Add 110 Libra to x’s Account

To mint Libra and add to x account, enter this command:

libra% account mint 0 110

  • 0 is the index of x account.

  • 110 is the amount of Libra to be added to Alice’s account.

A successful account mint command will also create Alice’s account on the blockchain.

Sample output on success:

Step 2: Add 52 Libra to Bob’s Account

To mint Libra and add to y account, enter this command:

libra% account mint 1 52

  • 1 is the index of y account.

  • 52 is the amount of Libra to be added to y account.

  • A successful account mint command will also create y account on the blockchain. Another way to create y account on the blockchain is to transfer money from x account to y account.

Sample output on success:

Step 3: Check the Balance

To check the balance in x account, enter this command:

libra% query balance 0

Sample output on success:

Balance is: 110

To check the balance in y account, enter this command:

libra% query balance 1

Sample output on success:

Balance is: 52

Submit a Transaction

Before we submit a transaction to transfer Libra from x account to y account, we will query the sequence number of each account. This will help us understand how executing a transaction changes the sequence number of each account.

Transfer Money

To submit a transaction to transfer 10 Libra from x account to y account, enter this command:

libra% transfer 0 1 10

  • 0 is the index of x account.

  • 1 is the index of y account.

  • 10 is the number of Libra to transfer from x account to y account.

Sample output on success:

Last updated