Skip to content

[c] Some unpolished instructions on installing OCaml and compiling Tezos for the mainnet and zeronet (revised 11 24 18)

maxtez-raspbaker edited this page Aug 17, 2019 · 9 revisions



Here some bare bones info to install OCaml and Opam and compile Tezos for the mainnet or zeronet.

Preliminary step: as a root/superuser install the following Fedora packages:
dnf install libev-devel rsync mercurial darcs hidapi hidapi-devel bubblewrap gmp gmp-devel which perl-Pod-Html


Part I Install or update OCaml (version 4.07.1) and Opam (version 2.0.5).
The following steps apply also if you have already installed Fedora 28 (aarch32/armv7) using the image file provided in this wiki pages (RPI3-TEZOS-050618.img).

Install the necessary opam program, as a root/superuser type:

(aarch32/armv7)
wget https://github.com/ocaml/opam/releases/download/2.0.5/opam-2.0.5-armhf-linux
then type
cp opam-2.0.5-armhf-linux /usr/local/bin/opam

or
(aarch64/armv8)
wget https://github.com/ocaml/opam/releases/download/2.0.5/opam-2.0.5-arm64-linux
then type
cp opam-2.0.5-arm64-linux /usr/local/bin/opam


and
chmod 755 /usr/local/bin/opam

then as a <user> move to the folder /home/<user> and type:

opam init --bare

this will initialize Opam and prepare the installation of OCaml (the current version of OCaml needed by Tezos is 4.07.1). To have a look at the existing configuration the following 2 commands can be used:
opam show
opam config list

and to update the list of available OCaml packages type:
opam update

then create a switch for tezos that will install OCaml 4.07.1:
opam switch create tezos ocaml-base-compiler.4.07.1

The process may take a while.

In case OCaml 4.07.1 is not the default installed version (find out with opam switch list), for example if tezos is not associated with the correct OCaml version, then as a <user> type:

opam switch remove "tezos"

and create a new one:

opam switch create tezos ocaml-base-compiler.4.07.1

and update the shell environment variables with:
eval $(opam env)

To save some space remove any OCaml version that is not 4.07.1, for example:

opam switch remove 4.04.2


Part II Compile and install Tezos (mainnet/zeronet)
If this is not an update (to update see below) on the same branch (mainnet or zeronet), as a <user> move to this location /home/<user> and remove the existing folder named /home/<user>/tezos:
rm -rf tezos

then get the latest copy of tezos for the mainnet or zeronet:

git clone -b mainnet https://gitlab.com/tezos/tezos.git
or
git clone -b zeronet https://gitlab.com/tezos/tezos.git

then type:

make build-deps
The process may take a while.

Then type:

make

The last two steps should be completed without errors. Look in the folder /home/tzuser/tezos for the green light! e.g. tezos-node, tezos-client and few others.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
If this is an update, to synchronize the local branch with the latest remote commits, from inside the tezos folder first type:

git fetch origin
this will synchronize your local repository with the central repository's and display the branches that were downloaded but will not merge with the local branch (in our case mainnet or zeronet). Then to see the new commits type:

git checkout mainnet
(or replace mainnet with zeronet) if new commits are numbered, then update the local branch with:

git pull
Now the local branch is up to date, type again git checkout mainnet and the following message will show up:
Already on 'mainnet'
Your branch is up to date with 'origin/mainnet'

If the command make build-deps was recently used, then there is a good chance that the dependencies (OCaml additional packages) have been already put in place, hence there is no need to do it again. To save some time, the command can be skipped. First type:

make clean
then

make
in case there are some errors related to failed dependencies, then the command make build-deps cannot be avoided and it has to be invoked before make.


NEWS

(archived NEWS on page [j])

  • 02/17/20 This is the end of the road for the tezos-rpi3 wiki, see the announcement in the UPDATES page [i]
  • 10/18/19 A new Tezos protocol has been activated (005). Some essential info in the UPDATES page [i]
  • 09/06/19 Next page [h] on forging and signing operations offline using Tezos
  • 09/02/19 New page [g] on using the Nitrokey HSM 2 with the Tezos-hsm-signer from Polychain Labs
  • 07/01/19(revised 07/04/19) New info on how to poke a node remotely on a local network (page [b] F-24), how to use the Tezos remote-signer locally and remotely (page [b] F-25), and how to restart automatically the Tezos programs using a crontab script (page [b] F-26 and page [d])
  • 06/06/19 Make permanent changes to the scheduler for the external hard drive (page [f])
  • 05/30/19 New protocol (004-Pt24m4xi) activated on May-30th-2019.
    Some changes on page [b] section F-18) about zram and page [f] about SSD and swap file.
  • 05/10/19 Kernel 5.x.x, new scheduler options. And also SSD, is it worth it? page [f]
  • 03/27/19 RPI3 back on the baking track after some tuning of the HDD I/O. See page [f]. These changes are essential.
  • 01/04/19 In the [g] Updates page few hints to keep the RPI3 node in sync while running the baking/endorsing daemons (revised 01/27/19)
Clone this wiki locally