Skip to content

Instantly share code, notes, and snippets.

@hclivess
Last active February 18, 2020 07:05
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hclivess/cfbc8eddb1f5692c619036cb47072934 to your computer and use it in GitHub Desktop.
Save hclivess/cfbc8eddb1f5692c619036cb47072934 to your computer and use it in GitHub Desktop.
Tezos Rolling Mode Guide (How To)

Tezos Rolling Mode Guide (How To)

Running Tezos in this mode will only store the blocks after latest snapshot, no longer requiring hundreds of gigabytes of drive storage space.

The software modification is provided by Nomadic Labs, details: https://blog.nomadic-labs.com/introducing-snapshots-and-history-modes-for-the-tezos-node.html

Upgrade only:

rm -rf tezos
wget https://gitlab.com/nomadic-labs/tezos/-/archive/mainnet-snapshots/tezos-mainnet-snapshots.zip
unzip tezos-mainnet-snapshots.zip
cd tezos-mainnet-snapshots
git checkout mainnet
make build-deps
make

If it fails:

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

Run node, no changes for other parts:

./tezos-node run --rpc-addr 127.0.0.1:8732 `bash get_peers.sh` --history-mode rolling

Full procedure:

sudo apt install bubblewrap
sudo apt install zip
wget https://gitlab.com/nomadic-labs/tezos/-/archive/mainnet-snapshots/tezos-mainnet-snapshots.zip
unzip tezos-mainnet-snapshots.zip
cd tezos-mainnet-snapshots
git checkout mainnet
sudo apt install curl
sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)
wget https://github.com/ocaml/ocaml/archive/4.06.1.zip
unzip 4.06.1.zip
cd ocaml-4.06.1
./configure -bindir /usr/bin -libdir /usr/lib/ocaml -mandir /usr/man/manl
make world
umask 022
sudo make install
cd
opam init
opam pin add jbuilder 1.0+beta20
eval $(opam env)
opam install -y astring base biniou cmdliner cohttp cohttp-lwt cohttp-lwt-unix conduit conduit-lwt conduit-lwt-unix cppo_ocamlbuild cpuid cstruct cstruct-lwt ezjsonm fieldslib fmt hex ipaddr irmin js_of_ocaml js_of_ocaml-compiler jsonm logs lwt mtime nocrypto ocaml-migrate-parsetree ocb-stubblr ocp-ocamlres ocplib-endian ocplib-json-typed ppx_ast ppx_core ppx_deriving ppx_driver ppx_fields_conv ppx_metaquot ppx_optcomp ppx_sexp_conv ppx_tools_versioned ppx_type_conv stdio topkg uri uutf yojson base64 cppo easy-format magic-mime ocaml-compiler-libs ppx_derivers ppx_traverse_builtins re result sexplib stringext
make build-deps
make

Create an identity, start RPC server, add address, activate:

./tezos-node identity generate 26


echo "curl -s 'http://api.tzscan.io/v2/network?state=running&p=0&number=50' | grep -Po '::ffff:([0-9.:]+)' | sed ':a;N;$!ba;s/\n/ /g' | sed 's/::ffff:/--peer=/g'" > get_peers.sh 

./tezos-node run --rpc-addr 127.0.0.1:8732 `bash get_peers.sh` --history-mode rolling
./tezos-client add address fundraiser <tz1...> 
./tezos-client activate fundraiser account fundraiser with <activation_key>

To import your fundraiser private key: ./tezos-client import fundraiser secret key fundraiser

Start baking (background service &), path to your node location:

./tezos-baker run with local node "/home/**user**/.tezos-node"
./tezos-endorser run "fundraiser"
./tezos-accuser run
@Javihache
Copy link

I cannot do git checkout mainnet in the folder where I unzip the tezos-mainnet-snapshots.zip file. I get an error "fatal: not a git repository (or any parent up to mount point /home)".
any ideas?

@TzBaker
Copy link

TzBaker commented May 13, 2019

Hey, I'm running the node by described above with rolling mode but sync started at the beginning and already use 50GB. I checked timestamp:
$ ./tezos-client get timestamp
2018–12–05T16:55:20Z
What I’m doing wrong?

@Phlogi
Copy link

Phlogi commented Jun 7, 2019

Same here, seems like experimental-rolling is not working as expected yet. My node went through the complete chain from the begining.

@hclivess
Copy link
Author

hclivess commented Jun 8, 2019

Hi, be careful, last time I tried I could not produce blocks or endorse. This is a bit misleading. Also it stores many gigabytes anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment