The command libra
is a new tool provided by latest libra-client version 0.5.x, which contains four subcommands account
, transaction
, wallet
and ledger
.
Here is some usage examples.
Leger Time Example
For example, using ‘ledger’ command to query the ledger start time and latest transaction time of testnet:
$ libra ledger time
You will get the json output like this:
{
"start_time": "2019-10-17T06:34:50",
"latest_time": "2019-10-17T14:02:41"
}
Wallet Example
To query the total balance of a wallet,
$ libra wallet balance <some mnemonic file of the wallet>
You will get the total balance and balance of every accounts in that wallet:
{
"7af57a0c206fbcc846532f75f373b5d1db9333308dbc4673c5befbca5db60e2f": 123,
"f1f48f56c4deea75f4393e832edef247547eb76e1cd498c27cc972073ec4dbde": 0,
"total_balance": 123
}
Account Balance Example
To query the balance of some account by address,
$ libra account balance 000000000000000000000000000000000000000000000000000000000a550c18
You will get the balance of that address:
{
"balance": 24075309756646968
}
The output of libra
command is the standard json format. So, it can be integrated to any programming language easily.
More instructions can be found here: