# Ledger Data Pruning

The **Ledger Data Pruning** introduces a cutting-edge functionality to our platform, enabling users to retain only the latest chain data by setting desired History Blocks.

Cron run every month which will remove chain data based on the History Blocks of each chain.

{% hint style="danger" %}
While pruning, chain cache data also remove , it may slow down the subgraph indexing of respective chain.
{% endhint %}

## Manage Ledger Data Pruning On Node

**Step 1:** Purchase **Ledger Data Pruning** addons by navigating to [Graph Nodes Purchase](https://app.traceye.io/subgraph/graph-node/purchase).

{% hint style="info" %}
Refer [Purchase Subscription](https://doc.traceye.io/services/dedicated-indexing/graph-nodes/quick-start-guide/purchase-subscription) page for more details.
{% endhint %}

**Step 2:** To enable the **Storage & Query Optimizer** addon service, navigate to the specific node where it needs to be enabled.

{% hint style="info" %}
Refer [Manage Addon Services](https://doc.traceye.io/services/dedicated-indexing/graph-nodes/graph-node-manual/manage-addon-services) page for more details.
{% endhint %}

**Step 3:** Select a node to navigate to its details page. In this page ledger data pruning can be configured on desired chain.

### Configure Pruning

To configure ledger data pruning for a chain, follow these steps:

1. Click the **Configure** button, a modal window will appear.

<figure><img src="https://461237800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtdewVLJM1K7okWyOstj%2Fuploads%2Fevwo7E1s1oK0jGI4Dc3v%2Fimage.png?alt=media&#x26;token=ad8fc910-0df6-46f4-9366-ab79c89e3591" alt=""><figcaption></figcaption></figure>

2. Set desired **History Blocks**. ( The minimum value must be set at 500, while the maximum value should align with the latest block of the subgraph. )

<figure><img src="https://461237800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtdewVLJM1K7okWyOstj%2Fuploads%2FVPvanTlqWh2OU5yf7joY%2Fimage.png?alt=media&#x26;token=d6db8644-8152-4c52-93a4-e49c3355b128" alt=""><figcaption></figcaption></figure>

3. Click the **Confirm** button to configure ledger data pruning, or click **Close** button to dismiss the modal without making changes.

### Deconfigure Pruning

To deconfigure ledger data pruning for a chain, follow these steps:

1. Click on the **Configure** **Icon** of desired chain, a modal window will appear.

<figure><img src="https://461237800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtdewVLJM1K7okWyOstj%2Fuploads%2Fjf8LZUjppPCtinnRd5IH%2Fimage.png?alt=media&#x26;token=17d4dd70-6797-4bd3-85a4-0974dd50603f" alt=""><figcaption></figcaption></figure>

2. Click on the **Delete Icon**, this will deconfigure ledger data pruning on the chain.

<figure><img src="https://461237800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtdewVLJM1K7okWyOstj%2Fuploads%2F1CA2scgmwosGT3T5yLaW%2Fimage.png?alt=media&#x26;token=16a1b65f-7242-4a33-a675-d98e7da1d6b7" alt=""><figcaption></figcaption></figure>
