mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-26 05:17:22 +00:00
9d7052796b
* restore beacon node db * revert image name * move restore out of the kv folder * remove files from kv folder * go mod tidy * Remove usage of prometheus testutil * add yes/no to prompt text * restore slasher db * organize imports * go mod tidy * restore validator db * close slasher db * defer close backup db in tests * simplify function literal
33 lines
806 B
Go
33 lines
806 B
Go
package db
|
|
|
|
import (
|
|
"github.com/prysmaticlabs/prysm/shared/cmd"
|
|
"github.com/prysmaticlabs/prysm/shared/tos"
|
|
"github.com/sirupsen/logrus"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
// DatabaseCommands for Prysm slasher.
|
|
var DatabaseCommands = &cli.Command{
|
|
Name: "db",
|
|
Category: "db",
|
|
Usage: "defines commands for interacting with eth2 slasher 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 := restore(cliCtx); err != nil {
|
|
logrus.Fatalf("Could not restore database: %v", err)
|
|
}
|
|
return nil
|
|
},
|
|
},
|
|
},
|
|
}
|