> For the complete documentation index, see [llms.txt](https://docs.pharos.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pharos.xyz/enable-pruning-in-pharos-node.md).

# Enable AutoPruning in Pharos Node

This guide describes how to enable automatic data pruning on your Pharos node to manage disk space.

***

## For v0.11+ Deployment (New Structure)

If you deployed your node using the v0.11 deployment guide (Binary or Docker with the new structure), follow these steps.

### Step 1: Verify Node Status

Check if the node is running:

```bash
curl -X POST -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
  http://localhost:18100
```

### Step 2: Enable Pruning

**For Binary Deployment:**

```bash
cd /data/$WORKSPACE/bin
./pharos_cli prune --c ../pharos.conf --enable_auto_prune
```

**For Docker Deployment:**

```bash
docker exec -it pharos-node /bin/bash
cd /data/bin
./pharos_cli prune --c ../pharos.conf --enable_auto_prune
```

### Step 3: Query Pruning Settings (Optional)

**For Binary Deployment:**

```bash
cd /data/$WORKSPACE/bin
./pharos_cli prune --c ../pharos.conf --get
```

**For Docker Deployment:**

```bash
docker exec -it pharos-node /bin/bash
cd /data/bin
./pharos_cli prune --c ../pharos.conf --get
```

Expected output:

```
PruneInfo:
enable_auto_prune: 1
auto_prune_reserved_window: 100000
prune_reserved_version: xxxxxx
flushed_version: xxxxxx
real_prune_reserved_version: xxxxxxx
```

If `enable_auto_prune` is `1`, auto pruning is enabled.

***

## For Legacy Deployment (Pre-v0.11)

If you deployed your node using the old Python ops tool, follow these steps.

### Step 1: Verify Node Status

```bash
curl 127.0.0.1:18100/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}'
```

### Step 2: Enable Pruning

Enter the container and enable auto-pruning:

```bash
docker exec -it pharos-testnet /bin/bash
cd /data/pharos-node/domain/client/bin/
./pharos_cli prune --enable_auto_prune
```

### Step 3: Query Pruning Settings (Optional)

```bash
docker exec -it pharos-testnet /bin/bash
cd /data/pharos-node/domain/client/bin/
./pharos_cli prune --get
```

Expected output:

```
PruneInfo:
enable_auto_prune: 1
auto_prune_reserved_window: 100000
prune_reserved_version: xxxxxx
flushed_version: xxxxxx
real_prune_reserved_version: xxxxxxx
```

If `enable_auto_prune` is `1`, auto pruning is enabled.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pharos.xyz/enable-pruning-in-pharos-node.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
