I'm wondering how to install the Tezos node
-
Downloading the full mainnet is broken into multiple pieces now, as its over Github's 2GB limit. After downloading the full snapshot ending in .00 and .01, one must use this command to extract into one file: ``` cat mainnet.full.* | xz -d -v -T0 > mainnet.importme ``` note: I left the output file suffix as .importme from the updated documentation on Github, just in case the piped output meeting the input regex would break things– markFeb 20, 2020 at 6:51
3 Answers
Here is a step by step updated guide on how to build a Tezos node from the sources on Ubuntu, also see my youtube video:
https://www.youtube.com/watch?v=SAHoF-oO71U
DOWNLOADS AND LINKS
Ubuntu download: https://ubuntu.com/download/desktop
Tezos node snapshot links: Available snapshots for main net? https://github.com/Phlogi/tezos-snapshots curl -s https://api.github.com/repos/Phlogi/tezos-snapshots/releases/latest | jq -r ".assets[] | select(.name) | .browser_download_url" | grep full | xargs wget -q --show-progress
How To: https://linuxconfig.org/how-to-extract-xz-compressed-archive-on-linux http://tezos.gitlab.io/user/snapshots.html
Tezos node: https://phoenixnap.com/kb/how-to-install-docker-on-ubuntu-18-04
Getting Started
become superuser
sudo su
update system
sudo su sudo apt update && sudo apt upgrade -y
install curl
sudo apt-get install curl
say yes to all prompts
install unizip tools
apt-get install xz-utils
######build Tezos node from sourcesall one line
sudo apt install -y rsync git m4 build-essential patch unzip bubblewrap wget pkg-config libgmp-dev libev-dev libhidapi-dev wget https://github.com/ocaml/opam/releases/download/2.0.3/opam-2.0.3-x86_64-linux 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 cd tezos git checkout mainnet
type "yes" for opam init command
opam init --bare make build-deps ## note: process 7 takes a long time eval $(opam env) make export PATH=~/tezos:$PATH source ./src/bin_client/bash-completion.sh export TEZOS_CLIENT_UNSAFE_DISABLE_DISCLAIMER=Y
install jp
sudo apt install -y jq
install opam
make build-deps make build-dev-deps ##takes a while eval $(opam env) make
generate tezos node ID ## if the tezos wasn't installed in /home/~, do a search for tezos
cd /home/'username'/tezos/
download node snapshot(saves you hours)
curl -s https://api.github.com/repos/Phlogi/tezos-snapshots/releases/latest | jq -r ".assets[] | select(.name) | .browser_download_url" | grep full | xargs wget -q --show-progress
find out th name of the file
ls /
unzip the file
unxz "name of file"
rename the file, taking note of the block number, rename to mainnet.full(without semicolons)
mv 'original file name.chain' 'mainnet.full'
create the tezos node identity, for the --block variable, use the block number located on the
./tezos-node identity generate
import the snapshot
./tezos-node snapshot import mainnet.full --block BMetLX2em7Q2tbAxcuPbUQNEY4NhRDEZtJCQeoFvWnYwDzb5qGU
kill original app using the ports(look for port 9732)
sudo lsof -i -P -n
kill -9 'PROCESS NUMBER USING PORT 9732/8732'
sudo kill -9 sudo lsof -t -i:8732
start the node
./tezos-node run --rpc-addr 127.0.0.1
note use lsof command if file is locked and then killall to stop the process, or unlock the file by rm the lock file in the path
wait for node to sync(watch progress with this command
./tezos-client bootstrapped
Your finished!!!
Setup nano ledger for baking
Connect ledger and list ledger devices
./tezos-client list connected ledgers
if using tezbox, copy the line that uses the path "ed25519"
import ledger key using path found above, create an 'ALIAS' which is any word/number so you don't need to type in the path every time
./tezos-client import secret key 'ALIAS' "ledger://path-determined-in-previous-step"
get chain ID
./tezos-client rpc get /chains/main/chain_id
copy output into chain ID below --> example:,NOTE: take out the <>, just use whats inside the brackets
./tezos-client setup ledger to bake for mack --main-chain-id "NetXdQprcVkpaWU"
start baker
./tezos-baker-005-PsBabyM1 run with local node /root/.tezos-node 'ALIAS'
start endorser
./tezos-endorser-005-PsBabyM1 run 'ALIAS'
start accuser
./tezos-accuser-005-PsBabyM1 run
I recently wrote and ansible role to do all this on debian machines : you can check it out here : https://gitlab.com/abate/training-2020-deploy/-/tree/master/ansible
I'm still working on the ssh tunnel that is not super reliable, but the rest seems working.
See http://tezos.gitlab.io/introduction/howtoget.html
It gives instructions for installing Tezos (the node, client, and other tools) in various forms: compiling the sources, precompiled binaries, docker containers, etc.