Tezos Mainnet — Setting Up Home Baking on Ubuntu

Last tested and updated: 21st February 2019

The mainnet was officially launched 17th September 2018, although it was was just a label change of the betanet. Betanet has been successfully running since 30th June 2018 and today the Tezos foundation announced the switch to the mainnet. https://twitter.com/TezosFoundation/status/1041675135412043776

Now that we have the mainnet official launch out of the way, we though we would update our setting up home baking instructions for Ubuntu 18.4.

Installing a Mainnet Tezos Node from Source on Ubuntu 18.4

These are the steps for installing the mainnet Tezos node from source on a fresh Ubuntu 18.4. These instructions are based on the source code version hash version of 225364d9ad201b566e2f15d47f04078e220493f0 and can be checked in the next few steps.

We tested our home baking install on iMac 4Ghz intel Core i7 with 32GB with a VM that had access to 8GB of memory and 4 processors. We give approximate times, where appropriate, based on this machine. The full install takes about 15 minutes but 18 hours to sync up the chain. The current disk space requirement is 90GB so, make sure you have at least 150GB before you start and preferably should be a SSD.

We are constantly building nodes and updating this document, if you have any issues please let us know. Theses instructions were used for building a node on the date specified above.

Important Note: we start each new command line with a $ and each line need to be run separately with a return. The $ is command prompt and should not be copied.

Install the libraries that Tezos is dependent on (~2 minutes)

$ sudo apt-get install build-essential git m4 unzip rsync curl bubblewrap libev-dev libgmp-dev pkg-config libhidapi-dev jbuilder

Pull down the source code from the git repository (~ 2 minites)

$ git clone https://gitlab.com/tezos/tezos.git
$ cd tezos
$ git checkout mainnet
$ git rev-parse HEAD
$ cd

The result hash should be the same as the one above and if you have a later version of the software then these instructions may not be complete.

Install the OPAM the package manager for OCaml (~4 minutes), answer with ‘y’ or just return to all prompts

$ sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)
$ opam init --comp=4.06.1
$ opam switch 4.06.1
$ opam update
$ eval $(opam env)

Building Tezos from source (~10 minutes), answer ‘y’ to all prompts

Note that when you run ‘make build-deps’ you will see: ‘[ERROR] No repository tezos found’, you can ignore this error.

$ cd tezos
$ make build-deps
$ eval $(opam env)
$ make

Node Set-up

Create the node identity (~1 minute)

The identity information and chain is stored in the directory ./tezos-node in your home directory.

$ ./tezos-node identity generate

Start-up the node

Run from a terminal (currently takes ~24 hours to sync when ran on the date above on a 1GB connection)

$ ./tezos-node run --rpc-addr :8732

Run without a terminal and write output to a tezos.log file.

$ nohup ./tezos-node run --rpc-addr :8732 --log-output tezos.log &

Baking

To run a baker, endorser and accuser.

$ ./tezos-baker-003-PsddFKi3 run with local node ~/.tezos-node <baking_address>
$ ./tezos-accuser-003-PsddFKi3 run
$ ./tezos-endorser-003-PsddFKi3 run <baking_address>

Useful Node Commands

This is a useful alias to set up in order to avoid the annoying warning splash screen. The rest of the commands below assume this alias has been run otherwise replace betanet with ./tezos-client

$ alias mainnet=’TEZOS_CLIENT_UNSAFE_DISABLE_DISCLAIMER=y ./tezos-client’

Generate a key with the alias my_account

The keys are stored in the directory ./tezos-client in your home directory. This is an important directory to backup.

$ mainnet gen keys my_account

Get balance of an account

$ mainnet get balance for my_account

Show wallet addresses and contracts (k addresses)

$ mainnet list known addresses
$ mainnet list known contracts

Create an originate contract for delegating

This will create a k address contract which delegates to a delegate_account

$ mainnet originate account my_originated for my_account transferring 1 from my_account --delegate delegate_account --delegatable

To change your delegate

$ mainnet set delegate for my_originated to another_delegate

Example of transferring XTZ

$ mainnet transfer 1 from my_account to bobs_account --fee 0

Useful Links

Tez Baker Tezos Delegation Service

Tezos Baker Comparison

Tez Baker GitHub

Cryptium Lab Payout

Benefits and Risks of Home Baking

Setting up a Secure Baker

Baking with a Ledger