3. Install a Tezos Node
Where the magic begins... Estimated duration: ~ 1 hour.

📖
1. Open a Terminal Window in Ubuntu

Press Ctrl+Alt+T. This will launch the Terminal.

🏭
2. Getting and building Tezos from source

Copy and paste these commands into the terminal line by line.
1
sudo apt install -y rsync git m4 build-essential patch unzip bubblewrap wget pkg-config libgmp-dev libev-dev libhidapi-dev
Copied!
Type your password when prompted.
[sudo] password for username:
1
cd $HOME
2
wget https://sh.rustup.rs/rustup-init.sh
3
chmod +x rustup-init.sh
4
./rustup-init.sh --profile minimal --default-toolchain 1.44.0 -y
5
6
source $HOME/.cargo/env
7
8
wget https://raw.githubusercontent.com/zcash/zcash/master/zcutil/fetch-params.sh
9
chmod +x fetch-params.sh
10
./fetch-params.sh
Copied!
1
wget https://github.com/ocaml/opam/releases/download/2.0.3/opam-2.0.3-x86_64-linux
2
sudo cp opam-2.0.3-x86_64-linux /usr/local/bin/opam
3
sudo chmod a+x /usr/local/bin/opam
4
git clone https://gitlab.com/tezos/tezos.git
5
cd tezos
6
git checkout latest-release
7
opam init --bare
Copied!
Answers the prompts with 'N' then 'y'.
1
make build-deps
2
eval $(opam env)
3
make
4
export PATH=~/tezos:$PATH
5
source ./src/bin_client/bash-completion.sh
6
export TEZOS_CLIENT_UNSAFE_DISABLE_DISCLAIMER=Y
Copied!
Congratulations! You built your own Tezos node.

3. Starting the Node

First, you must generate a new identity in order to connect to the Tezos network.
1
./tezos-node identity generate 26.
Copied!
This may take a few minutes to complete.

💿
4. Restore a snapshot

Rather than taking days to download the Tezos blockchain from the p2p network, a node can be quickly synchronized in a few minutes from snapshot.
Download a rolling mode snapshot from one of the following sources.
For example, here we will download from the first link both a rolling snapshot and a verification file, checksums.sha256.
First, we will install some tools.
1
sudo apt install -y jq curl
Copied!
1
cd ~/tezos
2
curl -s https://api.github.com/repos/Phlogi/tezos-snapshots/releases/latest | jq -r ".assets[] | select(.name) | .browser_download_url" | grep roll | xargs wget -q --show-progress
3
curl -s https://api.github.com/repos/Phlogi/tezos-snapshots/releases/latest | jq -r ".assets[] | select(.name) | .browser_download_url" | grep checksums.sha256 | xargs wget -q --show-progress
Copied!
Next, verify the sha256 checksum to validate that the file was downloaded correctly.
1
cat checksums.sha256 | grep mainnet.roll | sed -e 's/\(.*\) \(\/.*\/\)\(mainnet.roll*\)/\1\3/' > checksum
2
sha256sum -c checksum
Copied!
Ensure the checksum hash matches. This means the snapshot was downloaded fully and properly.
Sample output says OK when you successfully validate the file:
mainnet.roll.date.12345.chain.xz : OK
If the checksum did not match, you can try downloading the file again or try downloading a snapshot from a different source.
Extract the snapshot, then import the snapshot.
1
unxz mainnet.roll*
2
./tezos-node snapshot import mainnet.roll*
3
rm mainnet.roll* checksums.sha256 checksum
Copied!
🏸
FYI: Rolling mode vs Full mode
  • rolling mode are the most lightweight snapshots. Keeps a minimal rolling fragment of the chain and deleting everything before this fragment. Safe for baking, endorsing, and validating new blocks.
  • full mode store all chain data since the beginning of the chain, but drop the archived contexts below the current checkpoint. Safe for baking, endorsing, and validating new blocks.

🧱
5. Starting the node

1
./tezos-node run --rpc-addr 127.0.0.1:8732 --log-output tezos.log &
Copied!
The node will now catch up syncing with the live network.
Watch the progress by viewing tezos.log
1
tail -f tezos.log
Copied!
Downloading the latest blocks from peers, your node will gather the blocks created since the snapshot. To check the progress of syncing and to know when the node is ready, this command will exit when completely synced. Run the following in a new terminal.
1
cd ~/tezos
2
./tezos-client bootstrapped
Copied!