Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

Tezos baking howto

This howto is valid for Betanet on Ubuntu or Debian



You have to install some dependencies. In debian / ubuntu run:

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

If you are using ubuntu, install bubblewrap using this deb file:

sudo dpkg -i ./bubblewrap_0.2.1-1_amd64.deb

If you are using debian, install bubblewrap using the apt-get:

sudo apt-get install bubblewrap

Create an user and switch to it:

adduser tezos
adduser tezos sudo
su - tezos

Install the node from sources

Checkout the code:

git clone
cd tezos
git checkout mainnet

Install Opam (version 2.0 is required):

sudo mv opam-2.0.0-rc4-x86_64-linux /usr/local/bin/opam
sudo chmod a+x /usr/local/bin/opam
opam init --comp=4.06.1 --disable-sandboxing
opam switch 4.06.1
opam update
eval $(opam env)

Update Opam (if you have already installed opam):

opam update
opam switch 4.06.1 # Run this only if you are not already using 4.06.1 ocaml version
eval $(opam env)

Then compile the tezos node:

opam depext
eval $(opam env)
make build-deps
eval $(opam env)

Update the node

git pull
make build-deps

If it fails:

opam update
opam pin list -s | xargs opam pin remove
make build-deps

Update the node to new protocol

eval $(opam env) && make clean && git pull && make clean && make build-deps && eval $(opam env) && make
git rev-parse HEAD
./tezos-node upgrade storage
sudo apt-get install liblz4-tool -y
lz4 -d mainnet-BMKkyoQRCUHh2nLxZE4o6q3ExQDeGntNsdMKTbzq6gEXRg6HguV.full.tar.lz4 | tar xf -
rm -r ~/.tezos-node
./tezos-node snapshot import mainnet-BMKkyoQRCUHh2nLxZE4o6q3ExQDeGntNsdMKTbzq6gEXRg6HguV.full
./tezos-node identity generate 26

Node configuration

First generate a new identity and setup config:

./tezos-node identity generate

Start the node

cd tezos
nohup ./tezos-node run --rpc-addr --connections 20 &

Redeem your contribution (only betanet/mainnet)

First, activate your account using the kyc code:

./tezos-client add address fundraiser <tz1...>
./tezos-client activate fundraiser account fundraiser with <activation_key>

You can check if the account has been activated by getting its balance:

./tezos-client get balance for fundraiser

Then in order to access your funds importing your private key type the following command and write your private data when asked:

./tezos-client import fundraiser secret key "my_account"

Please be careful, you are importing your tezos private keys!


Register a delegate

Register a new delegate:

./tezos-client register key "my_account" as delegate

Start the baker

Use screen to start the baker and run it in background; it will ask you for the encryption key.

cd tezos
./tezos-baker-005-PsBabyM1 run with local node "/home/tezos/.tezos-node" "my_account"
cd tezos
./tezos-endorser-005-PsBabyM1 run "my_account"
cd tezos
./tezos-accuser-005-PsBabyM1 run


If you don't want to bake, you can vote another delegate. To vote a delegate, you should first "originate an account"; consider the implicit account called my_account2 with 6900XTZ, delegating to my_account:

./tezos-client originate account "my_originated" for "my_account2" transferring 6900 from "my_account2" --delegate "my_account" --delegatable

If you already have an originated account, you can delegate running:

./tezos-client set delegate for "my_originated" to "my_account"

Backup your keys

You private keys are located in:

  • /home/tezos/.tezos-node/identity.json
  • /home/tezos/.tezos-client/secret_keys.json




Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.