> 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 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://docs.pharos.xyz/enable-pruning-in-pharos-node.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.
