This is a brief how-to on installing Libra on a Pixelbook.
I typically use as my daily driver a Pixelbook in dev mode with Linux beta, mostly for Go and Flutter development. The docs seemed pretty straightforward, with three setup commands seen here: developers.libra.org
With my Pixelbook in this state, it means I have Go installed (one of the prerequisites for Libra Core protobuf compilation) and protoc. tl;dr. The Libra docs are very clear, but there were two issues, missing linux header lib and an outdated protoc - both are easily fixed.
It’s nice that the dependencies installer installs the prerequisites to build Libra Core, but I encountered an error while installing CMake:
Prerequisites installed by this script:
- Rust (and the necessary components, e.g. rust-fmt, clippy)
- CMake, protobuf, go (for building protobuf)
This is where the
./scripts/dev_setup.sh script bailed out:
Installing CMake...... E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. ghchinoy@penguin:~/dev/libra$ sudo dpkg --configure -a Setting up linux-compiler-gcc-6-x86 (4.9.168-1+deb9u3) ... dpkg: dependency problems prevent configuration of linux-headers-4.9.0-9-amd64: linux-headers-4.9.0-9-amd64 depends on linux-headers-4.9.0-9-common (= 4.9.168-1+deb9u3); however: Package linux-headers-4.9.0-9-common is not installed.
This is easily fixed via an apt install:
sudo apt update && sudo apt install linux-headers-4.9.0-9-common
After installing linux-headers-4.9.0-9-common , reran
./scripts/dev_setup.sh and almost everything went well… I had an older protoc and the script bombed out.
Following the instructions here, reproduced below, to upgrade/install protoc, I re-reran ./scripts/dev_setup.sh and had a clean install!
PROTOC_ZIP=protoc-3.7.1-linux-x86_64.zip curl -OL https://github.com/google/protobuf/releases/download/v3.7.1/$PROTOC_ZIP sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc sudo unzip -o $PROTOC_ZIP -d /usr/local include/* rm -f $PROTOC_ZIP
Starting a testnet was actually as simple as the third command. This did take a while to complete, as all the rust libs needed were downloaded and compiled, after which I was launched into the libra cli.
Finished dev [unoptimized + debuginfo] target(s) in 20m 57s
Then there was a nice little tutorial on how to create a transaction with sample Alice and Bob accounts: https://developers.libra.org/docs/my-first-transaction