Clone the Libra Core Repository

Setup Libra Core

To setup Libra Core, change to the libra directory and run the setup script to install the dependencies, as shown below:

cd libra

./scripts/dev_setup.sh

The setup script performs these actions:

Installs rustup — it is an installer for the Rust programming language, which Libra Core is implemented in.

— it is an installer for the Rust programming language, which Libra Core is implemented in. Installs the required versions of the rust-toolchain .

. Installs CMake — to manage the build process.

— to manage the build process. Installs protoc — a compiler for protocol buffers.

— a compiler for protocol buffers. Installs Go — for building protocol buffers.

If your setup fails, see Troubleshooting

Build Libra CLI Client and Connect to the Testnet

To connect to a validator node running on the Libra testnet, run the client as shown below.

./scripts/cli/start_cli_testnet.sh

Hold on tight, this might take some time.

Once the client connects to a node on the testnet, you will see the following output. To quit the client at any time, use the quit command.

Check If the CLI Client Is Running on Your System

If you see “connected to the validator” you’re all set. If not, please troubleshoot, see troubleshooting

Create Your Wallet Account

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

To create Alice’s account, enter this command:

libra% account create

Creating a wallet

If everything went fine, we should get a public address.

Creating the first wallet

#0 is the index of our account, and the hex string is the address of our account.

Transactions

For transactions, we need another wallet to send to. So create one again.

Creating the second wallet

You don’t have to remember all this, use the account list command.

List all accounts

Adding coins to our wallet

0 is the index of the wallet account.

150 is the amount of Libra to be added to our wallet.

A successful account mint command will also create the wallet #0 account on the blockchain.

Checking the balance

We query the balance of the wallet, remember the 0 is the index of our wallet.

Transfer Money

To submit a transaction to transfer 10 Libra from #0 account to #1 account, enter this command:

libra% transfer 0 1 10

0 is the index of #0 account.

1 is the index of #1 account.

Transferring money from wallet 0 to wallet 1

Checking the balance.

Congratulations!

You did it! We barely scratched the surface, next you should probably learn the Move language. Start here

The Libra Ecosystem

The Libra ecosystem consists of different types of entities:

Clients

A Libra client:

Is a piece of software that has the capability to interact with the Libra Blockchain.

Can be run by the end-user or on behalf of the end user (for example, for a custodial client).

Allows the user to construct, sign, and submit transactions to a validator node.

Can issue queries to the Libra Blockchain (through the validator node), request the status of a transaction or account, and verify the response.

Validator Nodes

Validator nodes are entities in the Libra ecosystem that collectively decide which transactions will be added to the Libra Blockchain. The validators use a consensus protocol so that they can tolerate the presence of malicious validators.

A validator node maintains the history of all the transactions on the blockchain. Internally, a validator node needs to keep the current state to execute transactions and to calculate the next state. We will learn more about the components of a validator node in Life of a Transaction.

Developers

The Libra ecosystem supports a wide variety of developers, ranging from people who contribute to Libra Core to those who build applications that use the blockchain. The term “developer” encompasses all of these groups. Developers might:

Build Libra clients.

Build applications to interact with a Libra client.

Write smart contracts to execute on the blockchain.

Contribute to the Libra Blockchain software.

More about Libra