{{{site en reconstruction...}}}

Compiling Tezos on a fresh Amazon EC2 machine

A straightforward guide for setting up a machine capable of compiling and running Tezos.

I assume you have created an Amazon EC2 account. If you haven't, it's not a big deal to do it, go there and just do it by clicking "Create a Free Account" and follow the instructions!

Now let's create an EC2 instance with Ubuntu 18.04 LTS and compile Tezos on it! (At the time of writing, this is the most recent Ubuntu LTS available.)

Go to EC2

Click on images to view them in full size. Links or buttons to click are circled in orange!


Start creating your instance


Choose Ubuntu 18.04 LTS


Pick a machine, for instance one that's free like on this screnshot

Click on "Review and Launch" unless you want to cherry-pick your machine's features...


Yes, we jump from Step 2 to Step 7 if we don't do the cherry-picking!


Create (or pick available) SSH keys, and download the private key, and launch the machine!


Wait a bit until your machine finishes booting up, and copy the IP address or the not-so-so--friendly-super-long-DNS-name so you can SSH to it


Connect to the newly set up machine

Below, replace west-2.pem.txt by the actual name of the key you downloaded from Amazon EC2. And replace by the proper IP address or the DNS name it was attributed.

# Get your ssh key in the proper location
mv Downloads/west-2.pem.txt .ssh/
# Set acceptable rights on the key
chmod 400 .ssh/west-2.pem.txt
# Remove that .txt extension if you wish
mv .ssh/west-2.pem.txt .ssh/west-2.pem
# Add the key to your ssh agent
ssh-add .ssh/west-2.pem
# Connect to your new machine
ssh -l ubuntu

Update your machine's packages

sudo apt update
sudo apt upgrade

Install required software

# Ubuntu packages
sudo apt install unzip bubblewrap gcc m4 libgmp-dev pkg-config libev-dev libhidapi-dev

# Opam and OCaml
sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)
opam init
eval $(opam env)

# Clone Tezos implementation
git clone git@gitlab.com:tezos/tezos.git && \
cd tezos && \
make build-deps

# Run all tests from the repository
make tezos-micheline.test tezos-accuser-alpha-commands.test bip39.test \
tezos-node.test tezos-accuser-alpha.test blake2.test tezos-p2p.test \
tezos-baker-alpha-commands.test build-test tezos-protocol-alpha.test \
tezos-baker-alpha.test tezos-protocol-compiler.test \
tezos-baking-alpha-commands.test tezos-protocol-demo.test \
tezos-baking-alpha.test hacl.test tezos-base.test \
tezos-protocol-environment-shell.test tezos-clic.test \
tezos-protocol-environment-sigs.test irmin-lmdb.test \
tezos-protocol-environment.test tezos-client-alpha-commands.test \
ledgerwallet.test tezos-protocol-genesis.test tezos-client-alpha.test \
ledgerwallet-tezos.test tezos-protocol-updater.test \
tezos-client-base.test lmdb.test tezos-rpc-http.test \
tezos-client-base-unix.test ocplib-ezresto-directory.test \
tezos-rpc.test tezos-client-commands.test ocplib-ezresto.test \
tezos-client-genesis.test tezos-shell-services.test \
ocplib-json-typed-browser.test tezos-shell.test tezos-client.test \
ocplib-json-typed-bson.test tezos-signer-backends.test \
tezos-crypto.test ocplib-json-typed.test tezos-data-encoding.test \
tezos-signer-services.test ocplib-resto-cohttp.test tezos-signer.test \
tezos-embedded-protocol-alpha.test ocplib-resto-directory.test \
tezos-stdlib.test tezos-embedded-protocol-demo.test \
ocplib-resto-json.test tezos-stdlib-unix.test \
tezos-embedded-protocol-genesis.test ocplib-resto.test \
tezos-storage.test tezos-endorser-alpha-commands.test pbkdf.test \
uecc.test tezos-endorser-alpha.test secp256k1.test \

# If for some reason running the tests doesn't work, run this:
eval $(opam env)

Et voilà!


© philippewang.info