In this chapter, we will see how to create and deploy your own node.
It is possible to define the directory where the data will be stored with
--data-dir (by default, it is in .tezos-node)
By default, the network is Mainnet but, you can specify the network with the
For example, the following command configure the node for the Florencenet Network and stores data in a specified directory:
More about Networks in the Networks chapter.
If you want to know more about possible alternative node configurations, check out Node Configuration
First, you must generate a new identity in order to connect to the Tezos network.
The identity comprises a pair of cryptographic keys that nodes use to encrypt the messages sent to each other.
Note that this is merely a network identity. It is not related in any way to a Tezos address on the blockchain.
It will take some time to generate the keys. An
identity.json file will then be generated in the
~/.tezos-node (by default) directory. It will contain our public and private keys. Keep it safe and secure!
Whenever a node starts, it tries to retrieve the most current head of the chain from its peers and all the block from the Genesis to that head. This can be a long process if there are many blocks to retrieve.
So, rather than taking days to download the Tezos blockchain from the P2P network, a node can be quickly synchronized in a few minutes from a snapshot.
The term snapshot is a bit of an unfortunate term as it already has another meaning in Tezos, which is the schedule for baking rights. To be clear, the snapshot we are talking about is completely different from the baking rights snapshot. This snapshot is a compressed copy of the chain from a certain block. To learn more about snapshots, here is an article from Nomadics Labs.
- Download the last rolling snapshot on this site snapshots-tezos.giganode.io (use the 'WEB' link)
The file is about 1.3 GB and should take a few minutes to download.
- Copy the file into the
A snapshot contains all the blocks from genesis to some point or at least x cycles in the past.
- rolling mode are the most lightweight snapshots. Keeping a minimal rolling fragment of the chain and deleting everything before this fragment. Safe for baking, endorsing, and validating new blocks.
- full mode store all chain data since the genesis block of the chain, but drop the archived contexts below the current checkpoint. Safe for baking, endorsing, and validating new blocks.
The mechanism of Snapshots can help to reduce the synchronization time.
The following command bootstraps an empty Tezos node from the
<snapshot.rolling> file to a rolling Tezos node.
This command should take a few minutes.
You can add the
--block <BLOCK_HASH> option argument to verify that the block contained in the snapshot is the one that you are expecting to import. Otherwise, don’t forget to check the hash of the imported block displayed by the node when importing.
When retrieving a snapshot, it can be useful to check the actual content of the snapshot. To do so, the node’s
snapshot info command can be used to display snapshot’s information such as:
- snapshot’s version
- chain name
- history mode
- targeted block hash, level and timestamp
The command can be used as following:
With the following command, the node will now catch up syncing with the live network.
--rpc-addr url:port activate's the RPC interface that will allow communication with the node. By default, it runs on port
8732, so it is not mandatory to specify it.
Watch the progress by viewing tezos.log
To stop viewing the log, press CTRL+C (Ubuntu and Mac OS).
The Tezos client can be used to interact with the node. It can query its status or ask the node to perform some actions. For example, after starting your node, you can check if it has finished synchronizing with the following command (you can use another terminal window if you still watch the log):
When you see the message
Node is Bootstrapped, your Tezos node is synced with the blockchain, and you may now perform operations on it.
Congratulations on setting up a node!
Be careful closing terminal windows because this stops the node.
In this module, we have seen how to install Tezos from sources, create our own node, synchronize it with the blockchain and finally launch it.
This module is a prerequisite to becoming a baker, and the Deploy Bakers module explains how to become a baker and start earning Tez rewards.