Création de Noeuds: Source GitLab
Les guides prennent en charge la compilation de Mainnet sur Debian, Ubuntu et macOS. Le sous-système Windows et Windows Linux n'est actuellement pas pris en charge.
Introduction
Cette procédure est minutieusement testée sur Debian 9.4. Il fonctionnerait également sur Ubuntu 18.04 et 16.04. Cela fonctionne également sur MacOS 10.13.5 si vous passez directement à l'étape d'installation d'Opam.
Ces étapes fonctionneraient également sur Raspberry Pi 3B et 3B + exécutant Ubuntu 18.04. Un disque dur externe est requis.
Alerte de Sécurité
These directions are for a quick build of a Mainnet server. Nothing is done here to harden the security of the server. Since the tezos code is complex and communicating with potentially malicious peers, consider that anything on the server could be exposed or exploited.
Change Log
2020-01-13: Make Opam installation directions more general, allowing for Opam 2.0.5
2018-08-31: Added libhidapi-dev as a system package dependency.
Steps
Login to new Debian or Ubuntu system and update its base packages. (In the following, replace "192.155.xxx.xxx" with the actual IP address of your server).
Create a user account for building and running tezos. The tezos
is name is arbitrary; pick your favorite -- just don't build and run services as root. If you already have a user account you can use that instead. Note that the make build-deps
step requires sudo rights when it first runs, to install some system packages via apt-get.
If you are on Ubuntu 16, do this to be able to install bubblewrap and latest version of git. Everyone else, ignore this.
Similarly, if you are on Debian 9, do this to upgrade git to version 2.18.0. You need the debian "stretch-backports" source enabled to do this. If the following command fails, see the "Add backports to your sources.list" section at https://backports.debian.org/Instructions/ and follow the steps there; then try this again.
If you are on Centos 7.5 some of the system package names are different. Use this instead of the apt-get
just below:
If you are on Arch Linux/Manjaro the above applies with pacman
:
Install the system packages needed to start building tezos binaries. The actual build scripts will install more packages.
(If you're on MacOS, you can start here.)
Install OPAM utility needed to build the OCaml code. Version 2.0.0 or later of opam is required. See https://opam.ocaml.org/doc/Install.html for alternative installation steps.
Opam installation:
If asked, just accept the default of installing to /usr/local/bin. Installing there depends on the 'tezos' user having sudo rights as we arranged above.
Opam installation, alternative manual method for MacOS and other:
Visit https://github.com/ocaml/opam/releases/. Find the newest stable 2.0.x release (2.0.5 works at the time of writing, January 2020) and download the binary executable for your architecture. Move that executable file to /usr/local/bin/opam and use chmod a+x
to make it executable.
Opam setup
Now that opam is installed, initialize it. (Allow it to update .profile, etc, at your own discretion).
If you are running in the Windows 10 Linux Subsystem you may need to add --disable-sandboxing
to the call to opam init
above. Otherwise you may be blocked by brwap
errors as bubblewrap does not currently work in that environment.
Note that the make build-deps
step below builds a local opam environment within the build directory, so we no longer need to set up a switch as we did before.
Get the mainnet source code.
Install OCaml dependencies (and some system package dependencies too). An error message about "No repository tezos found" is normal when running this step for the first time; you can ignore that error. If you see an error like "Could not update repository "tezos": Commit found, but unreachable: enable uploadpack.allowReachableSHA1InWant on server" then you need to start over and install a newer version of git. See above about upgrading git in Ubuntu 16 and Debian 9.
Compile the binaries. Since the build-deps step above created an _opam directory with an opam switch for tezos, update the environment again before compiling to be sure we've got the right opam configuration.
Configure the node identity. In the mainnet the "difficulty" used in generating the node identity must be at least 26. That is the default now in the identity generate
command.
Run the node. (I also like to run the node inside a screen(1)
session (without nohup
or &
) so that the process persists in the foreground and I can detach and come back to it later in another ssh session.)\
The node will take a while to sync, bringing in the blockchain data from the peers. To see its progress you can run the following command which shows the head block known so far and will exit when the node is fully synced:
Look for the timestamp
value in the output from that. When that value gets to within a minute or so of the current date and time then your node is synced. The expected network/chain_id value is NetXdQprcVkpaWU
.
Faster bootstrap
It's possible to start up your node with a copy of the chain data that is (typically) just a few days old. See the directions at https://tezosshots.com/.
To activate a donation account
The my_account
name/alias above is arbitrary, but conventional.
Note: you can also import your private key info, but that is not necessary in order to claim the donation account:
Also: if your goal is only to activate your Tezos account and claim the tez from the fundraiser, it’s much easier to just use stephenandrews online utility at https://stephenandrews.github.io/activatez/ .
Baking on Mainnet
See the Tezos baking howto by @dakk.
Workarounds when things won't build or run
In the top code directory, ~/tezos, run eval $(opam env)
. Then try again.
After doing eval $(opam env)
, do opam update && opam upgrade
. Then try again.
Sometimes it helps to remove the entire ~/.opam directory and start over again from the opam init
step. Slow, but it gives a clean start for OPAM packages. Note that if you are building alphanet or other from the same user, this also wipes out the OPAM context for that work too.
The make build-deps
step pins many packages to particular versions. If you want a clean start short of removing ~/.opam, you can remove all those pins:
If you get 0 connections, verify that your node identity was built with sufficient difficulty:
Fix issue in macOS
On macOS make build-deps
sometimes fails since it cannot build OCaml compiler. You may get the following error
Sandbox executable complains that there is not place to store compiler cache. You don't have /Users/username/.ccache
on your system. Install ccache
using your favourite package manager. Command for Homebrew:
If ccache
is installed, but you don't have /Users/username/.ccache
, run the following command to create the directory:
When you have /Users/username/.ccache
you should be able to install OCaml compiler using opam
.
Once you have OCaml compiler in opam
, you should be able to run make build-deps
although it will install its own OCaml compiler.
Rebuilding
To rebuild with the latest Mainnet code you can move or remove the "tezos" directory and start again from the git clone
step. As an alternative you can update in place as follows.
Details here:https://github.com/Blindripper/FAQ/blob/patch-1/Rebuilding_Mainnet.md
References
Baking info: https://gist.github.com/dakk/bdf6efe42ae920acc660b20080a506dd
Docker images: https://hub.docker.com/r/tezos/tezos/tags/
Docker script: https://gitlab.com/tezos/tezos/blob/mainnet/docs/introduction/howtoget.rst Copy to mainnet.sh and run as usual.
Korean version : https://blog.naver.com/justmustone/221310459511
Korean version : Raspberry Pi 3 https://blog.naver.com/justmustone/221310583691
About
Written by @fredcy with help from the tech chat room and others.
Last updated