cmd/geth: add db commands stats, compact, put, get, delete (#22014)

This PR introduces:

- db.put to put a value into the database
- db.get to read a value from the database
- db.delete to delete a value from the database
- db.stats to check compaction info from the database
- db.compact to trigger a db compaction

It also moves inspectdb to db.inspect.
# Conflicts:
#	cmd/geth/chaincmd.go
#	cmd/geth/main.go
#	cmd/utils/flags.go
#	core/rawdb/database.go
#	ethdb/leveldb/leveldb.go
This commit is contained in:
Martin Holst Swende 2021-02-23 11:27:32 +01:00 committed by Igor Mandrigin
parent 5aefc37618
commit fc0778d1f9

View File

@ -26,7 +26,7 @@ import (
)
var (
CommandHelpTemplate = `{{.cmd.Name}}{{if .cmd.Subcommands}} command{{end}}{{if .cmd.Flags}} [command options]{{end}} [arguments...]
CommandHelpTemplate = `{{.cmd.Name}}{{if .cmd.Subcommands}} command{{end}}{{if .cmd.Flags}} [command options]{{end}} {{.cmd.ArgsUsage}}
{{if .cmd.Description}}{{.cmd.Description}}
{{end}}{{if .cmd.Subcommands}}
SUBCOMMANDS:
@ -37,7 +37,7 @@ SUBCOMMANDS:
{{end}}
{{end}}{{end}}`
OriginCommandHelpTemplate = `{{.Name}}{{if .Subcommands}} command{{end}}{{if .Flags}} [command options]{{end}} [arguments...]
OriginCommandHelpTemplate = `{{.Name}}{{if .Subcommands}} command{{end}}{{if .Flags}} [command options]{{end}} {{.ArgsUsage}}
{{if .Description}}{{.Description}}
{{end}}{{if .Subcommands}}
SUBCOMMANDS: