Libra ❤ DigitalOcean

0
105

Libra = Facebook stable coin, and because it’s an open source so let have some fun!

https://libra.org/en-US/open-source-developers/

Prerequisites

Spawn new server

Nothing fancy here, I will go with MVP as usual. After this step you should get ipv4 for ssh in.

ssh root@123.45.67.89
If you stuck here please google for “how to ssh into DigitalOcean”, it’s off topic here sorry!

Clone the Libra Core Repository

Once you getting in, let’s follow doc step which is…

# Clone the Libra Core Repository
git clone https://github.com/libra/libra.git
# Setup Libra Core
cd libra
./scripts/dev_setup.sh
# Build Libra CLI Client and Connect to the Testnet
./scripts/cli/start_cli_testnet.sh

Problem #1

protoc version is too old. Update protoc to 3.6.0 or above. Abort
protoc version is too old. Update protoc to 3.6.0 or above. Abort

Solution #1

First thing first, check your protoc version

protoc --version

You should get…

libprotoc 3.0.0

Which is not match 3.6.0 obviously, so let’s upgrade it.

Protip : On macOs you could just…

brew install protoc

No brew? Install Homebrew then

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Back to our beloved Ubuntu, Let’s install protoc (3.8.0 ATM)

And you should get…

How to upgrade protoc for libra

Protobuf is already install yeah!

Problem #2

It take loooong time to compile

Yawnnn

Solution #2

  • Drink coffee ☕ we prepare above
  • Feed your cat
  • Wait for it (~80 minutes for building release version)

Problem #3

: error adding symbols: Memory exhausted
collect2: error: ld returned 1 exit status
error: aborting due to previous error
error: Could not compile `client`.
Memory exhausted

Solution #3

Use swapfile 4Gb (or use new 4Gb droplet)

Download and run

curl -OL https://gist.githubusercontent.com/katopz/45cd6ccb59b046c1c71a130cd728c9d7/raw/e218b269a00f0d8b8eb13f0ef8d4fe30ce8cf406/do-swap.sh
. do-swap.sh

And you should get…

testnet libra

From this point you should be able to “Create Alice’s and Bob’s Account” by following official guide below…

My First Transaction · Libra

I’m rich!

Recap

  • Use DigitalOcean with more than 4Gb of ram, swapfile is not recommend for production
  • Upgrade protoc version to match libra need (3.6.0 or above)
  • Coffee and Cat is optional!

What’s next?

  • RESTful for libra testnet
  • GraphQL for libra testnet
  • React Hook with libra testnet

To support content like this please feel free to tip me via…PayPal

Pay todsaporn banjerdkit using PayPal.Me

So I can buy some cloud credit for more libra testing and maybe libra through that later, Thanks! :)


Libra ❤ DigitalOcean was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this story.