How to setup Libra blockchain testnet?

Naveen Agarwal
Jul 10, 2019 · 5 min read
Image for post
Image for post
Libra blockchain testnet

Introduction

Facebook’s new stablecoin Libra is going to work in three parts; these three parts are going to work together in collaboration to form a more inclusive financial system:
· secure, scalable and reliable blockchain;

· backed by a basket of assets to give it balanced value;

· governed by an independent Libra association which will work to evolve the ecosystem.

With the stablecoin, Facebook has also introduced a Libra blockchain which is a decentralized, programmable database. The blockchain is designed to support a long-only cryptocurrency that can be exchanged around the world.

Setup Libra Blockchain Client

As per the official documentation, Libra blockchain client is currently only available for Linux(Red hat or Debian) or Mac Osx. Hence to make it platform independent, we are using docker with Debian base image.
We are assuming that docker is installed on system if not, then install it by visiting this link:- https://docs.docker.com/install/ .
Once the installation is complete, follow the instructions based on operating system. In case you don’t want to install dependencies manually, we have created a docker composer file, using that your docker will set up automatically, or run the process by finding the title “Using Docker Composer” below.

1. First of all we need to pull base image of Debian in docker:-

Image for post
Image for post

2. Now we need to run the container:-

Image for post
Image for post

3. Go inside the docker container to install Libra blockchain dependencies (find your container id, by running this command “docker ps”):-

Image for post
Image for post

4. Install git, curl and build tools:-

Image for post
Image for post

5. Install CMAKE:-

Image for post
Image for post

6. Install GO Lang:-

Image for post
Image for post

7. Install Protocol:-

Image for post
Image for post

8. Clone Libra from git:-

Image for post
Image for post

9. Setup Libra Core (it will download components, hence will take some time):-

Image for post
Image for post

Using Docker Composer

Please find docker composer file using this link https://github.com/aceoKvelland/libra/blob/master/docker-compose.yml, and download it on your local system. Make sure you have installed docker-composer in your local system, if not then you can install it via: https://docs.docker.com/compose/install/.

After installing docker compose, go to the path, where you have downloaded docker compose file “docker-compose.yml”, and run below command (it will take time, please wait till finish):-

Image for post
Image for post

Now, docker container will be created named as “libra-blockchain”, you can check it by running this command:-

While we are using docker-compose up -d , its installing dependencies in background, we can check the status of dependencies using this command:-

Image for post
Image for post

Test the transactions on Libra Blockchain Testnet

Now, we need to go inside the docker container, so that we can start Libra blockchain Testnet, using this command:-

  1. Build Libra client and connect to testnet (it will take some time):-
Image for post
Image for post

2. Create 2 accounts, let’s say user A and user B:-

Image for post
Image for post

Repeat this above command and it will create another account with index 1

3. To check account list:-

Image for post
Image for post

Here sequence number is number of transactions what we performed, when you created new accounts, it will show you “0” and status will be “local”. When we create a new account then it is created locally and not on the blockchain, till we perform transaction in those accounts.

4. To add tokens/coins into account A and B:-

Here “0” refers to account index and “100” refers to tokens/coins, we can use same command to mint tokens/coins into “B” account, just need to change “0” to “1” because “B” account’s index is “1”. Libra is using “Faucet” to mint tokens/coins on testnet. However, on mainnet it will not work.

5. To check the balance:-

Image for post
Image for post

Here “0” refers to account index of “A”.

6. To submit a transaction:-

Image for post
Image for post

Here “0” refers to account “A” and “1” refers to account “B” and “10” refers to number of tokens/coins.

Now we can check balance of both accounts using commands.

The Libra testnet network is set up to generate the address, mint the coins from test faucet and check the account state. Libra blockchain is still in the development stage and is set to launch next year.

Akeo

Official Medium publication for Akeo.Tech

Naveen Agarwal

Written by

Akeo

Akeo

Official Medium publication for Akeo.Tech focusing on innovation and spreading awareness about technologies that can disrupt current business models. Follow us to get deep insights into blockchain, AI & ML, Fintech, and Industry 4.0. More info at — www.akeo.tech

Naveen Agarwal

Written by

Akeo

Akeo

Official Medium publication for Akeo.Tech focusing on innovation and spreading awareness about technologies that can disrupt current business models. Follow us to get deep insights into blockchain, AI & ML, Fintech, and Industry 4.0. More info at — www.akeo.tech

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store