Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: db clear CLI #3936

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 113 additions & 40 deletions book/cli/db.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Commands:
Gets the content of a table for the given key
drop
Deletes all database entries
clear
Deletes all table entries
version
Lists current and local database versions
path
Expand Down Expand Up @@ -95,14 +97,85 @@ Display:
Silence all log output
```

## `reth db drop`
## `reth db stats`

Deletes all database entries
Lists all the tables, their entry count and their size

```bash
$ reth db drop --help
$ reth db stats --help

Usage: reth db drop [OPTIONS]
Usage: reth db stats [OPTIONS]

Options:
--datadir <DATA_DIR>
The path to the data dir for all reth files and subdirectories.

Defaults to the OS-specific data directory:

- Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/`
- Windows: `{FOLDERID_RoamingAppData}/reth/`
- macOS: `$HOME/Library/Application Support/reth/`

[default: default]

--chain <CHAIN_OR_PATH>
The chain this node is running.

Possible values are either a built-in chain or the path to a chain specification file.

Built-in chains:
- mainnet
- goerli
- sepolia

[default: mainnet]

-h, --help
Print help (see a summary with '-h')

Logging:
--log.persistent
The flag to enable persistent logs

--log.directory <PATH>
The path to put log files in

[default: /reth/logs]

--log.journald
Log events to journald

--log.filter <FILTER>
The filter to use for logs written to the log file

[default: error]

Display:
-v, --verbosity...
Set the minimum log level.

-v Errors
-vv Warnings
-vvv Info
-vvvv Debug
-vvvvv Traces (warning: very verbose!)

-q, --quiet
Silence all log output
```

## `reth db list`

Lists the contents of a table

```bash
$ reth db list --help

Usage: reth db list [OPTIONS] <TABLE>

Arguments:
<TABLE>
The table name

Options:
--datadir <DATA_DIR>
Expand All @@ -116,6 +189,11 @@ Options:

[default: default]

-s, --skip <SKIP>
Skip first N entries

[default: 0]

--chain <CHAIN_OR_PATH>
The chain this node is running.

Expand All @@ -128,6 +206,17 @@ Options:

[default: mainnet]

-r, --reverse
Reverse the order of the entries. If enabled last table entries are read

-l, --len <LEN>
How many items to take from the walker

[default: 5]

-j, --json
Dump as JSON instead of using TUI

-h, --help
Print help (see a summary with '-h')

Expand Down Expand Up @@ -238,18 +327,14 @@ Display:
Silence all log output
```

## `reth db list`
## `reth db drop`

Lists the contents of a table
Deletes all database entries

```bash
$ reth db list --help

Usage: reth db list [OPTIONS] <TABLE>
$ reth db drop --help

Arguments:
<TABLE>
The table name
Usage: reth db drop [OPTIONS]

Options:
--datadir <DATA_DIR>
Expand All @@ -263,11 +348,6 @@ Options:

[default: default]

-s, --skip <SKIP>
Skip first N entries

[default: 0]

--chain <CHAIN_OR_PATH>
The chain this node is running.

Expand All @@ -280,17 +360,6 @@ Options:

[default: mainnet]

-r, --reverse
Reverse the order of the entries. If enabled last table entries are read

-l, --len <LEN>
How many items to take from the walker

[default: 5]

-j, --json
Dump as JSON instead of using TUI

-h, --help
Print help (see a summary with '-h')

Expand Down Expand Up @@ -325,14 +394,18 @@ Display:
Silence all log output
```

## `reth db path`
## `reth db clear`

Returns the full database path
Deletes all table entries

```bash
$ reth db path --help
$ reth db clear --help

Usage: reth db path [OPTIONS]
Usage: reth db clear [OPTIONS] <TABLE>

Arguments:
<TABLE>
Table name

Options:
--datadir <DATA_DIR>
Expand Down Expand Up @@ -392,14 +465,14 @@ Display:
Silence all log output
```

## `reth db stats`
## `reth db version`

Lists all the tables, their entry count and their size
Lists current and local database versions

```bash
$ reth db stats --help
$ reth db version --help

Usage: reth db stats [OPTIONS]
Usage: reth db version [OPTIONS]

Options:
--datadir <DATA_DIR>
Expand Down Expand Up @@ -459,14 +532,14 @@ Display:
Silence all log output
```

## `reth db version`
## `reth db path`

Lists current and local database versions
Returns the full database path

```bash
$ reth db version --help
$ reth db path --help

Usage: reth db version [OPTIONS]
Usage: reth db path [OPTIONS]

Options:
--datadir <DATA_DIR>
Expand Down