💽Disk usage optimisation

This guide is suitable for all Cosmos network validators.

The blockchain grows in size over time. The filling rate of an SSD depends on the block production rate, the number of transactions in each block, the blockchain log settings, etc.

Below are practical tips that will help you slow down the growth of the blockchain on servers 10 times.

circle-exclamation

Editing config.toml

Let's start the setup by adjusting parameters of the file ~/.axelar_testnet/.core/config/config.toml

Indexing

The "Indexing" function is only needed by those who need to request transactions from a specific node. Most of the time this setting can be changed.

Open file editing by nano:

sudo nano ~/.axelar_testnet/.core/config/config.toml

Finding a string indexer = "info" and change the parameter to "null":

indexer = "null"

Indexing files are stored in the ~/.axelar_testnet/.core/data/tx_index.db/ directory. If you changed this parameter on a synchronized node that has already collected this information, then delete it with the command below:

sudo rm ~/.axelar_testnet/.core/data/tx_index.db/*

Logging

By default, the node state logging level is set to info, i.e. full display of all node information.

Это полезно при запуске ноды, чтобы убедиться что нода правильно работает.

This is useful when starting a node for the first time to make sure the node is working properly.

But after you understand that the node is working correctly and synchronizing, you can lower the log display level to warn (or even to error ).

This parameter can be in one of two places:

1. In the config file ~/.axelar_testnet/.core/config/config.toml

circle-exclamation

2. In the service file /etc/systemd/system/axelar.service.

circle-exclamation

It is important to understand:

circle-info

It doesn't matter where you change this parameter (in axelar.service or in config.toml), the main thing is that it should be in one place.

So, set the log parameter like this:

Save and exit.

Editing app.toml

The app.toml file is located at ~/.axelar_testnet/.core/config/app.toml .

State-sync snapshots

If we are not going to use the server for snapshots, then we need to set this parameter to zero.

We go down to the end of the file and turn off snapshot intervals (change the value to 0). But in Axelar this parameter is already set to 0. Let's check:

Configure pruning

If you closed the app.toml file, then open it with the nano editor:

And we should bring the lines with pruning to this form:

Restart Axelar

We have changed the Axelar config. Then for the changes to take effect, we need to restart the container.

After restart everything is ready. Now the disk space will last 10 times longer.

Last updated