Skip to content

Commit 31c7c3d

Browse files
garyschulteAlexandra Tran
andauthored
Add import/export trielog subcommands (#1782)
* addition of import/export trielog subcommands, relates to besu #6363 Signed-off-by: garyschulte <garyschulte@gmail.com> Co-authored-by: Alexandra Tran <alexandra.tran@consensys.net>
1 parent 116881d commit 31c7c3d

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

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

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,79 @@ You can configure the retention limit using [`--bonsai-historical-block-limit`](
449449
The retention limit should match the configuration used with [`--bonsai-limit-trie-logs-enabled`](options.md#bonsai-limit-trie-logs-enabled).
450450
The default limit is `512`.
451451

452+
#### `export`
453+
454+
<Tabs>
455+
456+
<TabItem value="Syntax" label="Syntax" default>
457+
458+
```bash
459+
besu --config-file <PATH-TO-CONFIG-FILE> storage trie-log export [--trie-log-block-hash=<list>] [--trie-log-file-path=<file>]
460+
```
461+
462+
</TabItem>
463+
464+
<TabItem value="Example exporting single trie log">
465+
466+
```bash
467+
besu --config-file config.toml storage trie-log export --trie-log-block-hash=0x0dcfa528de7d12df63673d0ebbd103dbf3a9464fae7eeb89e0934678cd05d64b
468+
```
469+
470+
:::note
471+
This example exports the trie log corresponding to a particular block hash into a file in the default location, `<data-dir>/trie-logs.bin`.
472+
:::
473+
474+
</TabItem>
475+
476+
<TabItem value="Example exporting list">
477+
478+
```bash
479+
besu --config-file config.toml storage trie-log export --trie-log-file-path=/tmp/list_of_trielogs.bin --trie-log-block-hash=0x0dcfa528de7d12df63673d0ebbd103dbf3a9464fae7eeb89e0934678cd05d64b,0xe8c3e77a6eaf6c87552aee07b86ecf4aacba43650b1d6aac32a44fa3ca97780d,0x86df7008b32fee67baac103846931c58454fc1b391e7d826c4886ba8580ba169
480+
```
481+
482+
:::note
483+
This example exports trie logs corresponding to a list of block hashes into a specific file location.
484+
:::
485+
486+
</TabItem>
487+
488+
</Tabs>
489+
490+
Exports the trie logs of blocks specified by hash to a binary file.
491+
492+
By default, Bonsai trie logs are regularly pruned, so the trie log for a given block might not be present if it has been pruned.
493+
If you need to manually import or export trie logs, we recommend temporarily disabling trie log pruning by setting
494+
[`--bonsai-limit-trie-logs-enabled`](options.md#bonsai-limit-trie-logs-enabled) to `false`.
495+
496+
#### `import`
497+
498+
<Tabs>
499+
500+
<TabItem value="Syntax" label="Syntax" default>
501+
502+
```bash
503+
besu --config-file <PATH-TO-CONFIG-FILE> storage trie-log import [--trie-log-file-path=<file>]
504+
```
505+
506+
</TabItem>
507+
508+
<TabItem value="Example">
509+
510+
```bash
511+
besu --config-file config.toml storage trie-log import --trie-log-file-path=/tmp/list_of_trielogs.bin
512+
```
513+
514+
</TabItem>
515+
516+
</Tabs>
517+
518+
Imports trie logs from a binary trie log export file.
519+
520+
By default, Bonsai trie logs are regularly pruned.
521+
If pruning is enabled, Besu might subsequently prune the imported trie logs.
522+
If you need to manually import or export trie logs, we recommend temporarily disabling trie log pruning by setting
523+
[`--bonsai-limit-trie-logs-enabled`](options.md#bonsai-limit-trie-logs-enabled) to `false`.
524+
452525
## `validate-config`
453526

454527
<Tabs>

0 commit comments

Comments
 (0)