Announcing libra-client: A CLI inteface Libra client and Python API for Libra blockchain

Hi everyone,

We have just published libra-client, an unofficial client for Libra blockchain written in python language. The project has a cli interface client allows you interact whith Libra Network easily. For Python programmers, you can also call the client side api to interact with Libra Network.

The client is compatible with original rust written libra client.

For python programmers, Please see Client side Libra API for python programmer for more API details.


Very nice, great job, it works well on latest Libra testnet and LCS.

1 Like

Libra-client is updated from version 0.3.x to version 0.4, with following major updates:

  1. add ledger_info and validator_verifier support. We verify the signature in ledger_info_with_sig structure against the validator’s public key.
  2. The get_transactions api now return deserialized SignedTransaction object instead of raw ptoto object.
  3. check connectivity on startup of libra_shell and check port number to be NonZeroU16.
  4. Update canoser library to support pretty print and update the api document.

During the development of libra-client, we found and fixed a few bugs in the libra core. For example, following input will raise an error:

libra% q tr 1 0 true

Getting committed transaction by range
[ERROR] Error getting committed transactions by range: Bad GetTransactions response. Events requested: true, events returned: false.

Here is the fix code:
Fix verify_get_txns_resp when zero txns returned

Other merged commits:

1 Like


Just finished to install it after installing python3.6m, pip3. I cannot use the command libra_shell

root@vps8279:~# libra_shell
libra_shell: command not found

EDIT: solved :wink:

1 Like


I facing a little connection trouble while attemting to use libra_shell :

Not able to connect to validator at

1 Like

Maybe a temporal network problem.

1 Like

Running ./ works but not libra_shell

1 Like

I see. It’s weird :innocent:

1 Like

Is this exception came from line 33 ?

1 Like

Yes. This line send a blank request message to libra ac to test validate network.


Add “-v” option, you can see detail message if there are errors.

$ libra_shell -v
1 Like

Still the same error message I inspect libra code source to see what can be the trouble :wink:

1 Like

After reading your code I found you use :

‘host’: “”,
‘port’: 8000,
‘faucet_host’: “

I tried to ping the faucet network but it’s still down do you think it’s the problem ?

1 Like

Only mint coin will use the ‘faucet_host’, try connect, for example:

telnet 8000
Connected to
Escape character is ‘^]’.

1 Like

I got the same result as you writte
root@vps8279:~/.local/bin# telnet 8000
Connected to
Escape character is ‘^]’.

1 Like

@ alexandre_jaquet
AFAIK, it seems fine.

1 Like

I think I found the reason. Uninstall and then reinstall with following command:

python3 -m pip install --user --no-binary libra-client libra-client

Let me know if it works.:grinning:

1 Like

Well done it work thanks a lot’s ! :slight_smile:

1 Like


I’m playing within your client and everything works well,

use warnings;
use MyDB;

my $db = MyDB->new();


sub get_balance {
my $account = shift || ‘’;
system(“libra account balance $account”);
sub main {

my ($userID,$acheteurEmail,$compte_libra) = $db->sqlSelect("id_personne,email,compte_libra", "personne", "nom_utilisateur = 'alexandre'");
print "Compte libra Alexandre : $compte_libra\n";



Libra-client is updated from version 0.5 to version 0.6, compatible with latest testnet update:

  1. Add Transaction and BlockMetadata class, parse message TransactionListWithProof to Transaction instead of SignedTransaction.
  2. Change epoch_num to epoch of LedgerInfo message.
  3. Disable proof verification Temporarily. There’s a lot of change to libra’s proof code, such as bitmap is remove.

Hi I update libra-client within the following line of code python3.6 -m pip install --user --no-binary libra-client libra-client but now when I call account balance I got :

root@vps8279:/usr/lib/cgi-bin# libra account balance f270b16e2fec7a10937d0c32eec34a9b2280a7ab8a64e75aa8c84e3583158349
“balance”: 0

but within the same adress within libra explorer