Tezos compilation guide for Ubuntu 18

Increase max number of ulimit open file in Linux

1.Step : open the sysctl.conf and add this line fs.file-max = 65536

$ vi /etc/sysctl.conf

add new line and

fs.file-max = 65536

save and exit.


$ vi /etc/security/limits.conf

and add below the mentioned

* soft     nproc          65535
* hard     nproc          65535
* soft     nofile         65535
* hard     nofile         65535

save and exit check max open file ulimit

# ulimit -a

open files                      (-n) 65535


Some of the code is repeated/unnecessary, feel free to provide a more concise guide

for Debian, see https://github.com/tezoscommunity/FAQ/wiki/Build-a-Betanet-node-on-Debian-9

You can skip all this and try run my precompiled libraries for Intel processors


For Ubuntu 16, you need:

upgrade to Ubuntu 18


sudo apt install bubblewrap
git clone https://gitlab.com/tezos/tezos.git
cd tezos
git checkout betanet
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

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 `bash get_peers.sh` 
./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" (this is NOT the executable path, but the hidden directory where user data are stored)
./tezos-endorser run "fundraiser"
./tezos-accuser run

Leave a Reply

Your email address will not be published. Required fields are marked *