Skip to main content

Disk Usage Optimization

Adjust the configuration options to reduce the amount of disk space needed by your validator node.

Depending on factors like block speed and transaction volume, the blockchain database tends to expand over time.

There are a few options that can be made to drastically reduce the needed disk use. The full effect of some of these adjustments will only be realized after you have configured them and started synchronization using them.

Indexing

You can turn off indexing if you don't need to query transactions from that particular node. Set in config.toml:

indexer = "null"

The collected index must be manually deleted if you do this operation on a node that has previously been synced. The database directory's data/tx_index.db/ contains the index's location.

State-sync snapshots

Set in app.toml:

snapshot-interval = 0

Configure pruning

The most recent 100 states and by default every 500th state are maintained. This uses up a lot of disk space over time and can be optimized using the custom setup listed below:

pruning = "custom"
pruning-keep-recent = "100"
pruning-keep-every = "0"
pruning-interval = "10"
danger

pruning-keep-recent = "0" may sound appealing, but doing so runs the danger of corrupting the database if the humansd is terminated for any reason. Therefore, it is advised to maintain the few most recent states.

Logging

The logging level is usually set to info, which generates a large number of logs. This log level may be beneficial at first to ensure that the node begins correctly syncing. However, once the syncing appears to be proceeding without any problems, you can set the log level to warn (or error). Configure the following in config.toml:

log_level = "warn"
danger

Make sure your log rotation is set up correctly.