Skip to content

Commit a71ad1e

Browse files
authored
docs: db clear CLI (paradigmxyz#3936)
1 parent 74bbe5a commit a71ad1e

File tree

1 file changed

+113
-40
lines changed

1 file changed

+113
-40
lines changed

book/cli/db.md

+113-40
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Commands:
1616
Gets the content of a table for the given key
1717
drop
1818
Deletes all database entries
19+
clear
20+
Deletes all table entries
1921
version
2022
Lists current and local database versions
2123
path
@@ -95,14 +97,85 @@ Display:
9597
Silence all log output
9698
```
9799

98-
## `reth db drop`
100+
## `reth db stats`
99101

100-
Deletes all database entries
102+
Lists all the tables, their entry count and their size
101103

102104
```bash
103-
$ reth db drop --help
105+
$ reth db stats --help
104106

105-
Usage: reth db drop [OPTIONS]
107+
Usage: reth db stats [OPTIONS]
108+
109+
Options:
110+
--datadir <DATA_DIR>
111+
The path to the data dir for all reth files and subdirectories.
112+
113+
Defaults to the OS-specific data directory:
114+
115+
- Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/`
116+
- Windows: `{FOLDERID_RoamingAppData}/reth/`
117+
- macOS: `$HOME/Library/Application Support/reth/`
118+
119+
[default: default]
120+
121+
--chain <CHAIN_OR_PATH>
122+
The chain this node is running.
123+
124+
Possible values are either a built-in chain or the path to a chain specification file.
125+
126+
Built-in chains:
127+
- mainnet
128+
- goerli
129+
- sepolia
130+
131+
[default: mainnet]
132+
133+
-h, --help
134+
Print help (see a summary with '-h')
135+
136+
Logging:
137+
--log.persistent
138+
The flag to enable persistent logs
139+
140+
--log.directory <PATH>
141+
The path to put log files in
142+
143+
[default: /reth/logs]
144+
145+
--log.journald
146+
Log events to journald
147+
148+
--log.filter <FILTER>
149+
The filter to use for logs written to the log file
150+
151+
[default: error]
152+
153+
Display:
154+
-v, --verbosity...
155+
Set the minimum log level.
156+
157+
-v Errors
158+
-vv Warnings
159+
-vvv Info
160+
-vvvv Debug
161+
-vvvvv Traces (warning: very verbose!)
162+
163+
-q, --quiet
164+
Silence all log output
165+
```
166+
167+
## `reth db list`
168+
169+
Lists the contents of a table
170+
171+
```bash
172+
$ reth db list --help
173+
174+
Usage: reth db list [OPTIONS] <TABLE>
175+
176+
Arguments:
177+
<TABLE>
178+
The table name
106179

107180
Options:
108181
--datadir <DATA_DIR>
@@ -116,6 +189,11 @@ Options:
116189

117190
[default: default]
118191

192+
-s, --skip <SKIP>
193+
Skip first N entries
194+
195+
[default: 0]
196+
119197
--chain <CHAIN_OR_PATH>
120198
The chain this node is running.
121199

@@ -128,6 +206,17 @@ Options:
128206

129207
[default: mainnet]
130208

209+
-r, --reverse
210+
Reverse the order of the entries. If enabled last table entries are read
211+
212+
-l, --len <LEN>
213+
How many items to take from the walker
214+
215+
[default: 5]
216+
217+
-j, --json
218+
Dump as JSON instead of using TUI
219+
131220
-h, --help
132221
Print help (see a summary with '-h')
133222

@@ -238,18 +327,14 @@ Display:
238327
Silence all log output
239328
```
240329

241-
## `reth db list`
330+
## `reth db drop`
242331

243-
Lists the contents of a table
332+
Deletes all database entries
244333

245334
```bash
246-
$ reth db list --help
247-
248-
Usage: reth db list [OPTIONS] <TABLE>
335+
$ reth db drop --help
249336

250-
Arguments:
251-
<TABLE>
252-
The table name
337+
Usage: reth db drop [OPTIONS]
253338

254339
Options:
255340
--datadir <DATA_DIR>
@@ -263,11 +348,6 @@ Options:
263348

264349
[default: default]
265350

266-
-s, --skip <SKIP>
267-
Skip first N entries
268-
269-
[default: 0]
270-
271351
--chain <CHAIN_OR_PATH>
272352
The chain this node is running.
273353

@@ -280,17 +360,6 @@ Options:
280360

281361
[default: mainnet]
282362

283-
-r, --reverse
284-
Reverse the order of the entries. If enabled last table entries are read
285-
286-
-l, --len <LEN>
287-
How many items to take from the walker
288-
289-
[default: 5]
290-
291-
-j, --json
292-
Dump as JSON instead of using TUI
293-
294363
-h, --help
295364
Print help (see a summary with '-h')
296365

@@ -325,14 +394,18 @@ Display:
325394
Silence all log output
326395
```
327396

328-
## `reth db path`
397+
## `reth db clear`
329398

330-
Returns the full database path
399+
Deletes all table entries
331400

332401
```bash
333-
$ reth db path --help
402+
$ reth db clear --help
334403

335-
Usage: reth db path [OPTIONS]
404+
Usage: reth db clear [OPTIONS] <TABLE>
405+
406+
Arguments:
407+
<TABLE>
408+
Table name
336409

337410
Options:
338411
--datadir <DATA_DIR>
@@ -392,14 +465,14 @@ Display:
392465
Silence all log output
393466
```
394467

395-
## `reth db stats`
468+
## `reth db version`
396469

397-
Lists all the tables, their entry count and their size
470+
Lists current and local database versions
398471

399472
```bash
400-
$ reth db stats --help
473+
$ reth db version --help
401474

402-
Usage: reth db stats [OPTIONS]
475+
Usage: reth db version [OPTIONS]
403476

404477
Options:
405478
--datadir <DATA_DIR>
@@ -459,14 +532,14 @@ Display:
459532
Silence all log output
460533
```
461534

462-
## `reth db version`
535+
## `reth db path`
463536

464-
Lists current and local database versions
537+
Returns the full database path
465538

466539
```bash
467-
$ reth db version --help
540+
$ reth db path --help
468541

469-
Usage: reth db version [OPTIONS]
542+
Usage: reth db path [OPTIONS]
470543

471544
Options:
472545
--datadir <DATA_DIR>

0 commit comments

Comments
 (0)