2020-12-07 20:36:43 +00:00
|
|
|
package db
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/prysmaticlabs/prysm/shared/cmd"
|
|
|
|
"github.com/prysmaticlabs/prysm/shared/tos"
|
|
|
|
"github.com/urfave/cli/v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
// DatabaseCommands for Prysm slasher.
|
|
|
|
var DatabaseCommands = &cli.Command{
|
|
|
|
Name: "db",
|
|
|
|
Category: "db",
|
2021-06-26 19:00:33 +00:00
|
|
|
Usage: "defines commands for interacting with the Prysm slasher database",
|
2020-12-07 20:36:43 +00:00
|
|
|
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 := restore(cliCtx); err != nil {
|
2021-01-11 20:03:28 +00:00
|
|
|
log.Fatalf("Could not restore database: %v", err)
|
2020-12-07 20:36:43 +00:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|