> For the complete documentation index, see [llms.txt](https://bitnet-whitepaper.gitbook.io/developer-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bitnet-whitepaper.gitbook.io/developer-docs/setup-and-configuration/disk-usage-optimization.md).

# Disk Usage Optimization

### Disk Usage Optimization for BitNet Validators

Running a validator node on BitNet requires careful disk usage planning, especially as the blockchain grows over time. This section provides configuration best practices to minimize disk consumption while maintaining validator stability.

#### Why Optimization Matters

Blockchains grow continuously due to block frequency, transaction volume, and state changes. Without optimization, validator nodes may require over **90 GB** of disk space in just a few weeks. With the following settings, this can be reduced to under **20 GB**.

#### Disable Transaction Indexing (Optional)

If your node does **not** need to query transactions, disable the transaction indexer:

In `config.toml`:

```toml
indexer = "null"
```

> If the node was previously synced with indexing enabled, the existing index must be removed manually:

```bash
rm -rf ~/.bitnetd/data/tx_index.db/
```

#### Disable Snapshots (Optional for Disk Savings)

If you're not using **state sync**, you may disable automatic snapshot creation:

In `app.toml`:

```toml
snapshot-interval = 0
```

{% hint style="danger" %}
Disabling snapshots saves space but disables rapid state sync capabilities for new nodes.
{% endhint %}

#### Enable Custom Pruning

BitNet allows pruning of older blockchain states to reduce database bloat. Use the following recommended configuration:

In `app.toml`:

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

{% hint style="danger" %}
Avoid setting `pruning-keep-recent = "0"` — this increases the risk of **database corruption** if the node crashes unexpectedly.
{% endhint %}

#### Reduce Log Verbosity

Logging at the default `info` level can produce excessive output. Once your validator is running smoothly, switch to a lower level to save disk and improve performance:

In `config.toml`:

```toml
log_level = "warn"
```

Also ensure that **log rotation** is enabled to prevent logs from consuming excessive disk space over time.

#### Example: Disk Usage Before and After Optimization

**Default Configuration:**

```
Total Usage: ~90 GB
- 70G ./application.db
- 9G  ./blockstore.db
- 5G  ./state.db
```

**Optimized Configuration:**

```
Total Usage: ~17 GB
- 9G  ./blockstore.db
- 5G  ./state.db
- 946M ./application.db
```
