From 37fd3b258427d83222c6100b3b94bb6cdf8ff392 Mon Sep 17 00:00:00 2001 From: Delweng Date: Wed, 1 Mar 2023 21:30:46 +0800 Subject: [PATCH] docs: add prune-block document Signed-off-by: Delweng --- docs/cli/README.md | 2 ++ docs/cli/server.md | 2 ++ docs/cli/snapshot.md | 4 +++- docs/cli/snapshot_prune-block.md | 30 ++++++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 docs/cli/snapshot_prune-block.md diff --git a/docs/cli/README.md b/docs/cli/README.md index d52a4fd836..d97e786686 100644 --- a/docs/cli/README.md +++ b/docs/cli/README.md @@ -46,6 +46,8 @@ - [```snapshot```](./snapshot.md) +- [```snapshot prune-block```](./snapshot_prune-block.md) + - [```snapshot prune-state```](./snapshot_prune-state.md) - [```status```](./status.md) diff --git a/docs/cli/server.md b/docs/cli/server.md index 49c7114781..ed101878f3 100644 --- a/docs/cli/server.md +++ b/docs/cli/server.md @@ -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) diff --git a/docs/cli/snapshot.md b/docs/cli/snapshot.md index 376220749b..cc7a908088 100644 --- a/docs/cli/snapshot.md +++ b/docs/cli/snapshot.md @@ -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. \ No newline at end of file +- [```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. \ No newline at end of file diff --git a/docs/cli/snapshot_prune-block.md b/docs/cli/snapshot_prune-block.md new file mode 100644 index 0000000000..b966cb5e0f --- /dev/null +++ b/docs/cli/snapshot_prune-block.md @@ -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) \ No newline at end of file