In mid 2019, I worked on the development of a service with Libra as the back-end blockchain network for a couple of months before Mastercard, Visa, eBay, and Stripe announced they have pulled out of Libra in October 2019.
In case you haven’t heard, Libra is a blockchain developed by Facebook with the goal of providing a global currency for billions of people, especially for those with no access to the financial ecosystem. More about Libra in the white paper here.
Since Libra is a relatively new project in active development, my team and I had little technical documentation and sample codes to count on. We had to do our own research from scratch. The Libra documentation is a good place to start. I wished there was something simpler and concise. So, I’m writing this article to serve as a reference for beginners, as well as for myself.
1. It is written in Rust, and runs with Cargo.
Libra blockchain is open-source software. The implementation of the Libra protocol is called Libra Core. Libra Core is written in Rust. The package manager for Rust is Cargo.
This means you will be seeing lots of commands using Cargo, like:
cargo run -p libra-swarm -- -s
This causes Cargo to run the libra-swarm package, starting a local blockchain with one validator node.
2. You can write smart contracts with Move.
Move is a new programming language. It contains a compiler called Move IR (intermediate representation) to convert text into Move bytecode. With Move, you can write your own scripts to interact with the Libra Core, such as transferring funds. Think of it as being the counterpart to Solidity, the language for implementing smart contracts on Ethereum.
However…
You cannot execute scripts on Libra testnet. You can only execute Move modules and transaction scripts running on your private Libra blockchain. It’s officially stated:
Note: Currently, you can run custom Move modules and scripts on a local network only, and not on the Libra testnet.
Looks like it’ll be some time before we are able to test out our smart contracts.
The Move technical paper is particularly helpful to us in learning in much more detail about the language.
3. Explore testnet transactions on the Libra Explorer.
The blockchain explorer for the Libra testnet is at https://libexplorer.com.
There, you can get Lib coins from the faucet service, at https://libexplorer.com/faucet. You’ll need a Libra testnet address for that.
4. Testnet is continuously improving.
As new changes are frequently pushed to testnet, the testnet could be reset.
Expect downtimes.
Expect database restarts.
Expect your test transactions to be lost.
Be sure to keep up to date on the latest testnet developments on the community page at https://community.libra.org/c/announcements/5.
5. The codebase is moving fast
The repository for Libra is on GitHub, at https://github.com/libra/libra. There are new commits everyday.
Though the default branch is on master
, there are times when we needed to run the testnet
branch locally in order run a validator node. From there we can perform transactions on the Libra testnet.
And, it would be a matter of days, if not weeks, that our validator nodes start failing. As it turns out usually, that substantial changes on the remote branch rendered our local testnet branch obsolete, fast. We just have to get everything up to date before we’re running smoothly back on track again.
There’s lots of exciting new developer experience improvements coming up. The Libra engineering team recently announced Libra Core Roadmap #2, with mentions of pre-mainnet and mainnet features on the horizon. It’s shared on their blog, at https://developers.libra.org/blog/.
For a project management view into what’s the team doing right now, they have a GitHub Kanban board.