Comment on page
3. Install a Tezos Node
Where the magic begins... Estimated duration: ~ 1 hour.
Press Ctrl+Alt+T. This will launch the Terminal.
Copy and paste these commands into the terminal line by line.
sudo apt install -y rsync git m4 build-essential patch unzip bubblewrap wget pkg-config libgmp-dev libev-dev libhidapi-dev
Type your password when prompted.
[sudo] password for username:
chmod +x rustup-init.sh
./rustup-init.sh --profile minimal --default-toolchain 1.44.0 -y
chmod +x fetch-params.sh
sudo cp opam-2.0.3-x86_64-linux /usr/local/bin/opam
sudo chmod a+x /usr/local/bin/opam
git clone https://gitlab.com/tezos/tezos.git
git checkout latest-release
opam init --bare
Answers the prompts with 'N' then 'y'.
eval $(opam env)
Congratulations! You built your own Tezos node.
First, you must generate a new identity in order to connect to the Tezos network.
./tezos-node identity generate 26.
This may take a few minutes to complete.
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,
First, we will install some tools.
sudo apt install -y jq curl
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
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
Next, verify the sha256 checksum to validate that the file was downloaded correctly.
cat checksums.sha256 | grep mainnet.roll | sed -e 's/\(.*\) \(\/.*\/\)\(mainnet.roll*\)/\1\3/' > checksum
sha256sum -c checksum
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.
./tezos-node snapshot import mainnet.roll*
rm mainnet.roll* checksums.sha256 checksum
FYI: Rolling mode vs Full mode
rollingmode 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.
fullmode 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.
./tezos-node run --rpc-addr 127.0.0.1:8732 --log-output tezos.log &
The node will now catch up syncing with the live network.
Watch the progress by viewing tezos.log
tail -f tezos.log
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.