> 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
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bitnet-whitepaper.gitbook.io/developer-docs/setup-and-configuration/disk-usage-optimization.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
