Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
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.
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.
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.
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.
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.
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.
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
.
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/.
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/ .
See the Tezos baking howto by @dakk.
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:
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.
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
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
Written by @fredcy with help from the tech chat room and others.
Step 1: Set up a Node; following this Step by Step Guide.
Step 2: Download the Full or rolling mode Snapshot File
Step 3: Copy the file into /tezos folder
Step 4: “./tezos-node snapshot import *Blockhash*.full”
Step 5: Delete the *Blockhash*.full file after succesful import.
Step 6: Start the Node “./tezos-node run –rpc addr 127.0.0.1:8732″
Download the Full or rolling mode Snapshot File.
Copy the file into the /tezos folder
Update your Tezos Node with
Step 4: If your node is running, stop the Node with Ctrl-c
Step 5: Backup your current ./tezos-node folder
(Especially the identity.json and peers.json)
Step 6: Delete your ./tezos-node Folder
Step 7: “./tezos-node snapshot import *Blockhash*.full”
Step 8: Delete the *Blockhash*.full file after succesful import
Step 9: Copy the backuped identity.json and peers.json into the ./tezos-node folder
Step 10: Start the Node “./tezos-node run –rpc addr 127.0.0.1:8732”
In this Guide, we will look at how to run a Tezos Node with Docker on Linux, this Guide is primarily meant for people who want to run a public node to use the RPC API, or as a baking fronted node, or similar.
Docker is a platform that allows users to run applications as “Containers” without the need to compile Source Code, you simply download a ready-made container image and start it, the same Container Image can run on many different operating systems, so there is no need to manually deal with OS-specific dependencies and libraries, this is by far the easiest way to run a tezos node.
Official docker images for tezos are premade and can be found here:
https://hub.docker.com/r/tezos/tezos
In the “Tags” section of this website, you will find all current versions of Tezos, we will have a look at this later, let’s make sure you have a running Docker setup first
Installing Docker on any modern Linux Distribution is quite easy, all we need to do is open a terminal and type this command:
After this we have to make sure your current user is allowed to execute docker commands, we can do that with:
For this change to take effect you will have to log out and log in again, after that you are able to create a test docker container with:
If this command succeeds, you have installed docker correctly, to make things easier here is a video of the entire process:
At this point we can start a tezos node with one single command:
This is just a test to see that everything works, this will tell docker to download the official tezos image from dockerhub and run the tezos-node command inside the docker container.
The command uses two special flags, the first one is –rm, this flag tells Docker to delete the container after it has exited, we usually don’t want this but for a testing container, this is ok.
The second flag is -it, which makes sure docker attaches the container to your open terminal, later when we want to run docker in the background we have to omit this.
After some time your tezos node will have found enough connections to other nodes and start syncing blocks, if it does not start immediately have patience, it should look like this:
In this section we will look at different Options and Settings we can tweak when running a Tezos Node with Docker, and also install Prometheus and Grafana, a comprehensive Monitoring System.
First, we will need to enable “Swarm Mode” of our docker installation. Swarm Mode allows docker to do many awesome things like Load-balancing across multiple machines, we will not take advantage of many of those great features in this Guide, we just use it because it makes our life a lot easier, so let’s enable docker swarm:
This will generate Output about how to add other machines for more complicated setups, we will ignore this.
We are gonna need a location where the tezos node will store its data, so let’s create a directory for that:
and set permissions for that folder:
In the above directory, we will create a config.json file that holds all configuration options for tezos, a minimal config.json looks like this:
Here are three common options we can set in the config:
Tezos supports 3 different history modes, these affect the amount of storage needed by your node and how much information is available in the RPC API.
These mores are:
full stores all data since the beginning of the chain but removes archived data
rolling most lightweight, only stores data since the last snapshot.
archive stores everything, requires a lot of Storage space
You can set the mode in the config like this:
Here you can specify the inital peers your node will connect to, specify them like this:
In private mode your node will not connect to nodes other than your bootstrap peers, Bakers often do this to hide their IP and only connect to one ”Frontend Node” that is hosted somewhere else, enable it with:
You can view all possible config options with this command:
We will save our docker setup in a file so we can keep track of the configuration, so create a docker-compose.yml file with the following content:
In this file we define:
what image to use
what the start command is
what ports we want to have available ( RPC Port and P2P port )
where to store the tezos data
the maximum resource limits to 1 CPU and 4096 MB Ram
and how to restart the node if it fails
Now we can deploy our setup with:
and can check if the node is running with either docker ps
or docker service ls
, and we can see the node logs with
$ docker service logs tezos_mainnet -f
While we wait for our Node to start syncing Blocks, lets setup our Monitoring System.
For this we will use the Grafana + Prometheus Stack from https://github.com/stefanprodan/swarmprom, so lets git clone this project…
…create a run.sh file with the following content…
..and start the monitoring setup:
Wait a minute for everything to download and start, then open your browser and access your monitoring dashboard at http://localhost:3000, it should look like this:
We now have a running Tezos Node + Monitoring System, there is a lot more to get into that are beyond the scope of this Guide and depend on your Use-Case, for example, Grafana can be set up to send you Slack notifications in case your nodes throws an error, Or if you run this on a public server you should not expose your RPC port to the world like we did in this Guide, to do this change the port section in the docker-compose to:
For more information on all RPC calls I recommend looking at the official documentation here:https://tezos.gitlab.io/tezos/api/rpc.html
And for all other questions I recommend you join us in our matrix/riot chat on https://tzchat.org/ :)
Comment migrer de Tezbox vers d'autres portefeuilles.
Comment les utilisateurs peuvent identifier s'ils ont un portefeuille logiciel ou matériel.
TODO: Migration de Tezbox vers Kukai
TODO: Migration de Tezbox vers Galleon