Becoming a Desmos mainnet genesis validator — Part 2
As described inside Part 1, the first Desmos mainnet is set to start on August 31st at 15:00 UTC. Until now we have collected all the genesis transactions that different validators submitted and we are now ready for the final step: setting up the nodes and get them ready to start.
Downloading the final genesis 📥
After the closure of the genesis transaction submission process, we have collected all transactions and generated the final genesis file.
What you now need to do is to simply download such file and replace your current local genesis file. To do this you can run the following command from within your node:
curl https://raw.githubusercontent.com/desmos-labs/mainnet/main/genesis.json > ~/.desmos/config/genesis.json
To verify that the data has been downloaded correctly, you can run the following command and make sure that the output shasum is the same as you see here:
$ jq -S -c -M '' genesis.json | shasum -a 256
9b0f233e0e6f5ca0190468f43e655a07431ef9acc0c0124789bb094b9340e6a4 -
If the shasum matches, you are good to go. Otherwise, try re-downloading it until it matches.
Setting up and starting the node 🔧
Finally, you need to setup your node. This means:
- updating your Desmos version;
- updating the seed nodes it uses;
- updating the minimum gas prices;
- updating the pruning you want to use;
- enabling state sync;
- setting up Cosmovisor;
- starting the node.
Updating your Desmos version 🆕
First thing first, you need to make sure you are running the correct Desmos version on your node. For the first Desmos mainnet we will use Desmos v1.0.1
. You can get this either downloading it from the release page, or with the following commands:
git clone https://github.com/desmos-labs/desmos.git
cd desmos
git fetch --all --tags --force && git checkout tags/v1.0.1
make install
To make sure you have the correct Desmos version, you can use the command
desmos version --long
This should be its output:
$ desmos version --long
name: Desmos
server_name: desmos
version: 1.0.1
commit: 852bfd12f234126f1c9e48e785c5bb8fbcd96647
Updating the seed nodes 🌱
During the running of our mainnet, we will use the following seed nodes:
9bde6ab4e0e00f721cc3f5b4b35f3a0e8979fab5@seed-1.mainnet.desmos.network:266565c86915026093f9a2f81e5910107cf14676b48fc@seed-2.mainnet.desmos.network:2665645105c7241068904bdf5a32c86ee45979794637f@seed-3.mainnet.desmos.network:26656
You can add those addresses inside the ~/.desmos/config/config.toml
file:
# Comma separated list of seed nodes to connect to
seeds = "9bde6ab4e0e00f721cc3f5b4b35f3a0e8979fab5@seed-1.mainnet.desmos.network:26656,5c86915026093f9a2f81e5910107cf14676b48fc@seed-2.mainnet.desmos.network:26656,45105c7241068904bdf5a32c86ee45979794637f@seed-3.mainnet.desmos.network:26656"
Updating the minimum gas prices ⛽
The second thing that it’s important to set are the node’s minimum gas prices. These are used to avoid users spamming the chain with transactions without paying any fee.
To set them, you can edit the minimum-gas-prices
field inside the ~/.desmos/config/app.toml
file.
We recommend setting this to 0.001udsm
. This means that everyone performing a transaction with a gas amount of 200,000
(the default value) will have to pay a minimum amount of 200udsm
for it to be included inside the block.
Updating the pruning options 🚮
Another important thing to do is to make sure your node is using the pruning option that you prefer. This is done by editing the pruning
field inside the ~/.desmos/config/app.toml
file.
There are three values that we suggest:
- pruning set to
nothing
if you want to have an archive node that stores all the chain’s history. This will result in larger disk space usage; - pruning set to
everything
if you don’t want to store anything. This will result in less disk usage but more CPU usage; - pruning set to
default
to store some of the data. This will result in a medium disk usage and a medium CPU usage.
If you know what you are doing, you can also set the pruning
to custom
and manually set the pruning-keep-recent
, pruning-keep-every
and pruning-interval
values.
Enabling snapshots 🤝
Once you have properly setup your node’s pruning strategy, you can now enable state sync snapshots.
This is the new feature that was introduced with Tendermint Core v0.34 and allows your node to take periodic snapshots of its state and share them with new nodes that might join the network later. If every node enables state sync snapshots there will be more snapshots taken and shared, and new nodes will be able to jump on board faster allowing the security of the Desmos chain to grow more efficiently.
Please note that in order to enable state sync snapshots, you need to have a
pruning
strategy that is not set toeverything
. It needs to be eithernothing
,default
orcustom
.
To enable state sync snapshots you can simply edit the snapshot-interval
and snapshot-keep-recent
fields or the [state-sync]
section of your ~/.desmos/config/app.toml
file:
snapshot-interval
indicates how often the snapshots should be taken. If you usenothing
you can set any value. If you usedefault
it must be a multiple of500
. If you usecustom
it must be a multiple ofpruning-keep-every
.
We generally recommend to set this to either500
or1000
.snapshot-keep-recent
indicates how many snapshots should be persisted at most. We recommend setting this to2
.
Setting up Cosmovisor 🔭
Finally, the last thing we suggest you to do is setting up Cosmovisor. This will allow you to manage your node more easily as it will take care of upgrading it automatically once some on-chain upgrades are required.
To set it up please refer to the guide on our documentation website here.
Starting up the node 🏃
Once you have performed all the above steps, it’s now time to start your Desmos node! If you have followed our guides, you should be able to do this by running
sudo systemctl start desmosd
This should start the node, which will keep waiting until the genesis time comes. To see this you can run
sudo journalctl -u desmosd -f
You should be able to see the following log:
INF This node is a validator......INF Genesis time is in the future. Sleeping until then... genTime=2021-08-31T15:00:00Z
If you see this, congratulations! You have successfully prepared your node to be able to participate in consensus once genesis time is reached! 🚀
Time to relax 🛀
Now that your node is started and waiting for the genesis time, it is time for you to do the same! Sit back, relax and enjoy the rest of your time while we all wait for the launch 😎.
Special thanks 🙏
Once again we would like to thanks everyone that has supported us till now, allowing us to continue this journey. We can’t wait to see where this will bring all of us and how we can benefit the community thanks to a series of improved social enabled apps.
We recommend everyone joining our Discord server and following us on Twitch, there will be interesting things coming there!