Enable AutoPruning in Pharos Node

1. Step1: Node Status Verification

You can use the RPC API to check whether the node is actively running.

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

2. Step2: Enable Pruning

Enter the container pharos-testnet and use the tool to enable auto-pruning

docker exec -it pharos-testnet /bin/bash
cd /data/pharos-node/domain/client/bin/
LD_PRELOAD=./libevmone.so ./pharos_cli prune --enable_auto_prune

Once the above operations are complete, the node will automatically begin pruning its database.

3. (Optional)Step 3: Query Pruning Settings

Following the preceding steps, you may now query the pruning configurations

docker exec -it pharos-testnet /bin/bash
cd /data/pharos-node/domain/client/bin/
LD_PRELOAD=./libevmone.so ./pharos_cli prune --get

In the output logs, you can see the following information:

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 set to 1, it indicates that auto pruning has been enabled.

Last updated