mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 16:37:39 +00:00
886d76fe7c
* Define `cli.App` without mutation. No functional change. * `usage.go`: Clean `appHelpTemplate`. No functional change is added. Modifications consist in adding prefix/suffix `-` to improve readability of the template without adding new lines in template inference. We now see some inconsistencies of the template: - `if .App.Version` is around the `AUTHOR` section. - `if .App.Copyright` is around both `COPYRIGHT` and `VERSION` sections. - `if len .App.Authors` is around nothing. * `usage.go`: Surround version and author correctly. * `usage.go`: `AUTHOR` ==> `AUTHORS` * `usage.go`: `GLOBAL` --> `global`. * `--grpc-max-msg-size`: Remove double default. * VC: Standardize help message. - Flags help begin with a capital letter and end with a period. - If a flag help begins with a verb, it is conjugated. - Expermitemtal, danger etc... mentions are between parenthesis. * VC help message: Wrap too long lines.
36 lines
946 B
Go
36 lines
946 B
Go
package db
|
|
|
|
import (
|
|
beacondb "github.com/prysmaticlabs/prysm/v4/beacon-chain/db"
|
|
"github.com/prysmaticlabs/prysm/v4/cmd"
|
|
"github.com/prysmaticlabs/prysm/v4/runtime/tos"
|
|
"github.com/sirupsen/logrus"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
var log = logrus.WithField("prefix", "db")
|
|
|
|
// Commands for interacting with a beacon chain database.
|
|
var Commands = &cli.Command{
|
|
Name: "db",
|
|
Category: "db",
|
|
Usage: "Defines commands for interacting with the Ethereum Beacon Node database",
|
|
Subcommands: []*cli.Command{
|
|
{
|
|
Name: "restore",
|
|
Description: `restores a database from a backup file`,
|
|
Flags: cmd.WrapFlags([]cli.Flag{
|
|
cmd.RestoreSourceFileFlag,
|
|
cmd.RestoreTargetDirFlag,
|
|
}),
|
|
Before: tos.VerifyTosAcceptedOrPrompt,
|
|
Action: func(cliCtx *cli.Context) error {
|
|
if err := beacondb.Restore(cliCtx); err != nil {
|
|
log.WithError(err).Fatal("Could not restore database")
|
|
}
|
|
return nil
|
|
},
|
|
},
|
|
},
|
|
}
|