Skip to content

Commit

Permalink
docs: add prune-block document
Browse files Browse the repository at this point in the history
Signed-off-by: Delweng <delweng@gmail.com>
  • Loading branch information
jsvisa committed Mar 1, 2023
1 parent 1d5aa57 commit cdce971
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@

- [```snapshot```](./snapshot.md)

- [```snapshot prune-block```](./snapshot_prune-block.md)

- [```snapshot prune-state```](./snapshot_prune-state.md)

- [```status```](./status.md)
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ The ```bor server``` command runs the Bor client.

- ```bor.withoutheimdall```: Run without Heimdall service (for testing purpose) (default: false)

- ```bor.devfakeauthor```: Run miner without validator set authorization [dev mode] : Use with '--bor.withoutheimdall' (default: false)

- ```bor.heimdallgRPC```: Address of Heimdall gRPC service

- ```bor.runheimdall```: Run Heimdall service as a child process (default: false)
Expand Down
4 changes: 3 additions & 1 deletion docs/cli/snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

The ```snapshot``` command groups snapshot related actions:

- [```snapshot prune-state```](./snapshot_prune-state.md): Prune state databases at the given datadir location.
- [```snapshot prune-state```](./snapshot_prune-state.md): Prune state databases at the given datadir location.

- [```snapshot prune-block```](./snapshot_prune-block.md): Prune ancient chaindata at the given datadir location.
30 changes: 30 additions & 0 deletions docs/cli/snapshot_prune-block.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Prune ancient blockchain

The ```bor snapshot prune-block``` command will prune historical blockchain data stored in the ancientdb. The amount of blocks expected for remaining after prune can be specified via `block-amount-reserved` in this command, will prune and only remain the specified amount of old block data in ancientdb.


The brief workflow as below:

1. backup the the number of specified number of blocks backward in original ancientdb into new ancient_backup,
2. then delete the original ancientdb dir and rename the ancient_backup to original one for replacement,
3. finally assemble the statedb and new ancientdb together.

The purpose of doing it is because the block data will be moved into the ancient store when it becomes old enough(exceed the Threshold 90000), the disk usage will be very large over time, and is occupied mainly by ancientdb, so it's very necessary to do block data pruning, this feature will handle it.

## Options

- ```datadir```: Path of the data directory to store information

- ```keystore```: Path of the data directory to store keys

- ```datadir.ancient```: Path of the old ancient data directory

- ```block-amount-reserved```: Sets the expected reserved number of blocks for offline block prune (default: 1024)

- ```cache.triesinmemory```: Number of block states (tries) to keep in memory (default = 128) (default: 128)

- ```check-snapshot-with-mpt```: Enable checking between snapshot and MPT (default: false)

### Cache Options

- ```cache```: Megabytes of memory allocated to internal caching (default: 1024)

0 comments on commit cdce971

Please sign in to comment.