Skip to content

Commit 5caba7a

Browse files
siladujoaniekubejoan e
authored
Add rocksdb and trie-log subcommands to storage command (#1642)
* Add rocksdb and trie-log subcommands to storage command Signed-off-by: Simon Dudley <simon.dudley@consensys.net> * copy edits Signed-off-by: joan e <joan.edwards@consensys.net> * Slight reword Signed-off-by: joan e <joan.edwards@consensys.net> * update Signed-off-by: joan e <joan.edwards@consensys.net> --------- Signed-off-by: joan e <joan.edwards@consensys.net> Co-authored-by: Joan E <153745173+joaniefromtheblock@users.noreply.github.com> Co-authored-by: joan e <joan.edwards@consensys.net>
1 parent 17bdb98 commit 5caba7a

File tree

1 file changed

+126
-3
lines changed

1 file changed

+126
-3
lines changed

docs/public-networks/reference/cli/subcommands.md

Lines changed: 126 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,15 +306,15 @@ If you need to downgrade Besu, run this subcommand before installing the previou
306306
<TabItem value="Syntax" label="Syntax" default>
307307

308308
```bash
309-
besu storage revert-variables --config-file <PATH-TO-CONFIG-FILE>
309+
besu --config-file <PATH-TO-CONFIG-FILE> storage revert-variables
310310
```
311311

312312
</TabItem>
313313

314314
<TabItem value="Example" label="Example">
315315

316316
```bash
317-
besu storage revert-variables --config-file ../besu-local-nodes/config/besu/besu1.conf
317+
besu --config-file config.toml storage revert-variables
318318
```
319319

320320
</TabItem>
@@ -326,6 +326,129 @@ If you need to downgrade Besu, first run this subcommand specifying the path to
326326
the [configuration file](../../how-to/use-configuration-file/index.md) normally used to
327327
start Besu.
328328

329+
### `rocksdb usage`
330+
331+
<Tabs>
332+
333+
<TabItem value="Syntax" label="Syntax" default>
334+
335+
```bash
336+
besu --config-file <PATH-TO-CONFIG-FILE> storage rocksdb usage
337+
```
338+
339+
</TabItem>
340+
341+
<TabItem value="Example" label="Example">
342+
343+
```bash
344+
besu --config-file config.toml storage rocksdb usage
345+
```
346+
347+
</TabItem>
348+
349+
<TabItem value="Example output" label="Example output">
350+
351+
```bash
352+
|--------------------------------|-----------------|-------------|-----------------|------------------|
353+
| Column Family | Keys | Total Size | SST Files Size | Blob Files Size |
354+
|--------------------------------|-----------------|-------------|-----------------|------------------|
355+
| BLOCKCHAIN | 2355141414 | 933 GiB | 166 GiB | 767 GiB |
356+
| VARIABLES | 26 | 240 KiB | 240 KiB | 0 B |
357+
| ACCOUNT_INFO_STATE | 9634454 | 496 MiB | 496 MiB | 0 B |
358+
| ACCOUNT_STORAGE_STORAGE | 24041432 | 1 GiB | 1 GiB | 0 B |
359+
| CODE_STORAGE | 37703864 | 12 GiB | 12 GiB | 0 B |
360+
| TRIE_BRANCH_STORAGE | 1885032116 | 138 GiB | 138 GiB | 0 B |
361+
| TRIE_LOG_STORAGE | 267301 | 17 GiB | 17 GiB | 0 B |
362+
|--------------------------------|-----------------|-------------|-----------------|------------------|
363+
| ESTIMATED TOTAL | 4311820607 | 1104 GiB | 337 GiB | 767 GiB |
364+
|--------------------------------|-----------------|-------------|-----------------|------------------|
365+
```
366+
367+
</TabItem>
368+
369+
</Tabs>
370+
371+
Displays the disk space used by the RocksDB key-value database, categorized into column families.
372+
373+
### `trie-log`
374+
375+
Provides actions related to managing, recording, and logging changes for the Bonsai Trie data.
376+
377+
#### `count`
378+
379+
<Tabs>
380+
381+
<TabItem value="Syntax" label="Syntax" default>
382+
383+
```bash
384+
besu --config-file <PATH-TO-CONFIG-FILE> storage trie-log count
385+
```
386+
387+
</TabItem>
388+
389+
<TabItem value="Example" label="Example">
390+
391+
```bash
392+
besu --config-file config.toml storage trie-log count
393+
```
394+
395+
</TabItem>
396+
397+
<TabItem value="Example output" label="Example output">
398+
399+
```bash
400+
trieLog count: 742311
401+
- canonical count: 681039
402+
- fork count: 217
403+
- orphaned count: 61055
404+
```
405+
406+
</TabItem>
407+
408+
</Tabs>
409+
410+
Displays the number of trie logs in the database.
411+
This is the number of keys for the `TRIE_LOG_STORAGE` [column family in RocksDB](#rocksdb-usage).
412+
The following are specified in the `trieLog count`:
413+
- `canonical count` represents the finalized blockchain.
414+
- `fork count` represents non-finalized branches of the blockchain.
415+
- `orphaned count` represents trie logs not in the blockchain, which can occur during block creation.
416+
417+
#### `prune`
418+
419+
<Tabs>
420+
421+
<TabItem value="Syntax" label="Syntax" default>
422+
423+
```bash
424+
besu --config-file <PATH-TO-CONFIG-FILE> storage trie-log prune
425+
```
426+
427+
</TabItem>
428+
429+
<TabItem value="Example" label="Example">
430+
431+
```bash
432+
besu --config-file config.toml storage trie-log prune
433+
```
434+
435+
</TabItem>
436+
437+
<TabItem value="Example setting retention limit" label="Example setting retention limit">
438+
439+
```bash
440+
besu --config-file config.toml --bonsai-historical-block-limit=1024 storage trie-log prune
441+
```
442+
443+
</TabItem>
444+
445+
</Tabs>
446+
447+
Removes all trie log layers below the specified retention limit, including orphaned trie logs.
448+
You can configure the retention limit using [`--bonsai-historical-block-limit`](options.md#bonsai-historical-block-limit).
449+
The retention limit should match the configuration used with [`--bonsai-limit-trie-logs-enabled`](options.md#bonsai-limit-trie-logs-enabled).
450+
The default limit is `512`.
451+
329452
## `validate-config`
330453

331454
<Tabs>
@@ -341,7 +464,7 @@ besu validate-config --config-file <PATH-TO-CONFIG-FILE>
341464
<TabItem value="Example" label="Example">
342465

343466
```bash
344-
besu validate-config --config-file ../besu-local-nodes/config/besu/besu1.conf
467+
besu validate-config --config-file config.toml
345468
```
346469

347470
</TabItem>

0 commit comments

Comments
 (0)