Ultimate Guide to Building a Tezbook on the Cheap

4 minute read

NOTE: this guide is most likely out of date. Please see http://doc.tzalpha.net/ for the latest information.

This guide will show you how to turn a ~$170 chromebook into a Tezbook, a lightning-fast linux computer with everything you need to start developing smart contracts on the Tezos platform.

On a personal note, this was a learning process for me, so if you see something missing, or wrong, or if you know of a shortcut, feel free to submit a pull request! This blog written in markdown and is entirely open source on github.

Buy your supplies

You’ll need a chromebook suitable for GalliumOS (check compatibility here), and a display, keyboard, and mouse to make your life easier (Chromebooks are tiny and hard to type on, I find.) I’ve added my recommendations for buying a full “Tezbook Kit” on Amazon at the bottom of this post, if you find that helpful.

Installing GalliumOS

GalliumOS is a fast and lightweight Linux distro for ChromeOS devices. You can dual-boot and keep the original ChromeOS install very easily with chrx. (Note that if you dual-boot, you’ll need to allocate adequate space for GalliumOS. I actually ended up starting off with chrx and then switching to a full GalliumOS install.) If you bought the Samsung Chromebook 3 (Intel Braswell processor) as I did, note that you will need to install a firmware update before doing anything else. From the GalliumOS wiki:

chrx Installation

Installing GalliumOS via chrx allows you to dual-boot GalliumOS alongside ChromeOS. Check the chrx hardware compatibility list to see if your device supports chrx, and whether any preparation steps are required.

See chrx installation instructions for full details, but here's a quick overview:

  1. Prepare your ChromeOS device: see Installing/Preparing
  2. Boot device into ChromeOS and configure networking; you do not need to log in
  3. Switch to a virtual terminal by pressing Ctrl+Alt+F2(top row right arrow), then log in as user chronos with no password
  4. Run chrx: curl -O https://chrx.org/go && sh go (see chrx docs for additional options)
  5. Follow on-screen prompts to repartition your SSD and install GalliumOS. If this is the first time running chrx on this ChromeOS machine, chrx will reboot after the partitioning step and you will need to continue the installation by running chrx again with the same command line.
  6. After reboot, at the white "OS verification is OFF" screen, press Ctrl+L for GalliumOS, or Ctrl+D for ChromeOS

Using Docker and the Alphanet

The following instructions are for installing the master Tezos branch on your computer. If you’d like to install the alphanet instead, that may be much easier, especially if you are already using docker. Detailed instructions here.

Installing Tezos Dependencies

Now that you’ve installed GalliumOS, we can get started on installing the libraries that Tezos will need. We’ll be building on the instructions in the Tezos github repo.

Install OPAM

Open up the terminal and run the following:

	sudo apt-get dist-upgrade
	sudo add-apt-repository ppa:nilarimogard/webupd8
	sudo apt-get update
	sudo apt-get install caffeine-plus
	sudo apt-get install joe
	sudo apt-get install build-essential
	wget https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh -O - | sh -s /usr/local/bin
	opam switch tezos --alias-of 4.04.2
	eval `opam config env`

Git Clone the Tezos Repo

Install git

sudo apt-get install git

Clone the repo

git clone https://github.com/tezos/tezos.git

cd tezos

Find out which libraries we need

Before we run make build-deps like the Tezos README tells us, we need to ensure that we have all the necessary libraries ready. If we don’t do that, we’re going to get messages that look like this:

=-=- conf-gmp.1 troobleshooting -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> This package relies on external (system) dependencies that may be missing.
   `opam depext conf-gmp.1' may help you find the correct installation for your
   system.

=-=- conf-leveldb.1 troobleshooting -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> This package relies on external (system) dependencies that may be missing.
   `opam depext conf-leveldb.1' may help you find the correct installation for
   your system.

=-=- conf-libev.4-11 troobleshooting =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> This package relies on external (system) dependencies that may be missing.
   `opam depext conf-libev.4-11' may help you find the correct installation for
   your system.

=-=- conf-m4.1 troobleshooting =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> This package relies on external (system) dependencies that may be missing.
   `opam depext conf-m4.1' may help you find the correct installation for your
   system.

=-=- conf-openssl.1 troobleshooting -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> This package relies on external (system) dependencies that may be missing.
   `opam depext conf-openssl.1' may help you find the correct installation for
   your system.
Makefile:18: recipe for target 'build-deps' failed

The problem, AFAIK, is generally that GalliumOS isn’t one of the recognized linux operating system names, like Ubuntu, ArchLinux, etc., so it doesn’t show up in mapping of the OS to recommended library names. You can see all of the recommended library names per OS by running opam list --rec --required-by conf-libev,conf-m4,conf-oppenssl,conf-gmp,leveldb --external

More info about dealing with errors and installing libraries with OPAM here.

I ran the command to find the library names, and GalliumOS uses the same libraries as Ubuntu. You can install the correct packages with this command:

sudo apt-get install -y libgmp3-dev libev-dev libssl-dev m4 pkg-config libleveldb-dev libsnappy-dev

Install Sodium

Sodium is a special case: we need 1.0.11 or higher.

wget http://archive.ubuntu.com/ubuntu/pool/main/libs/libsodium/libsodium18_1.0.11-1_amd64.deb

sudo dpkg -i libsodium18_1.0.11-1_amd64.deb

wget http://archive.ubuntu.com/ubuntu/pool/main/libs/libsodium/libsodium-dev_1.0.11-1_amd64.deb

sudo dpkg -i libsodium-dev_1.0.11-1_amd64.deb

Finish the Install

Install Tezos dependencies:

make build-deps

Compile the project:

make

Additional Tools

Emacs

sudo apt-get install emacs

Interact with the Tezos Community on your new Tezbook

IRC

hexchat is already installed, and you can chat at #tezos on freenode.

Slack-like group chat

https://riot.im/app/#/room/#tezos:matrix.org

Community Forums

https://www.tezos.community/

Reddit

https://www.reddit.com/r/tezos/

Full Tezos Kit from Amazon.

I chose the following setup (Affiliate links marked as such):