mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 02:31:19 +00:00
588dea83b7
* test coverage and updates to config twiddlers * LoadChainConfigFile error if SetActive conflicts * lint * wip working around test issues * more fixes, mass test updates * lint * linting * thanks deepsource! * fix undeclared vars * fixing more undefined * fix a bug, make a bug, repeat * gaz * use stock mainnet in case fork schedule matters * remove unused KnownConfigs * post-merge cleanup * eliminating OverrideBeaconConfig outside tests * more cleanup of OverrideBeaconConfig outside tests * config for interop w/ genesis gen support * improve var name * API on package instead of exported value * cleanup remainders of "registry" naming * Nishant feedback * add ropstein to configset * lint * lint #2 * ✂️ * revert accidental commented line * check if active is nil (replace called on empty) * Nishant feedback * replace OverrideBeaconConfig call * update interop instructions w/ new flag * don't let interop replace config set via cli flags Co-authored-by: kasey <kasey@users.noreply.github.com>
75 lines
2.2 KiB
Go
75 lines
2.2 KiB
Go
package historycmd
|
|
|
|
import (
|
|
"github.com/prysmaticlabs/prysm/cmd"
|
|
"github.com/prysmaticlabs/prysm/cmd/validator/flags"
|
|
"github.com/prysmaticlabs/prysm/config/features"
|
|
"github.com/prysmaticlabs/prysm/runtime/tos"
|
|
"github.com/sirupsen/logrus"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
// Commands for slashing protection.
|
|
var Commands = &cli.Command{
|
|
Name: "slashing-protection-history",
|
|
Category: "slashing-protection-history",
|
|
Usage: "defines commands for interacting your validator's slashing protection history",
|
|
Subcommands: []*cli.Command{
|
|
{
|
|
Name: "export",
|
|
Description: `exports your validator slashing protection history into an EIP-3076 compliant JSON`,
|
|
Flags: cmd.WrapFlags([]cli.Flag{
|
|
cmd.DataDirFlag,
|
|
flags.SlashingProtectionExportDirFlag,
|
|
features.Mainnet,
|
|
features.PraterTestnet,
|
|
features.RopstenTestnet,
|
|
cmd.AcceptTosFlag,
|
|
}),
|
|
Before: func(cliCtx *cli.Context) error {
|
|
if err := cmd.LoadFlagsFromConfig(cliCtx, cliCtx.Command.Flags); err != nil {
|
|
return err
|
|
}
|
|
return tos.VerifyTosAcceptedOrPrompt(cliCtx)
|
|
},
|
|
Action: func(cliCtx *cli.Context) error {
|
|
if err := features.ConfigureValidator(cliCtx); err != nil {
|
|
return err
|
|
}
|
|
if err := exportSlashingProtectionJSON(cliCtx); err != nil {
|
|
logrus.Fatalf("Could not export slashing protection file: %v", err)
|
|
}
|
|
return nil
|
|
},
|
|
},
|
|
{
|
|
Name: "import",
|
|
Description: `imports a selected EIP-3076 compliant slashing protection JSON to the validator database`,
|
|
Flags: cmd.WrapFlags([]cli.Flag{
|
|
cmd.DataDirFlag,
|
|
flags.SlashingProtectionJSONFileFlag,
|
|
features.Mainnet,
|
|
features.PraterTestnet,
|
|
features.RopstenTestnet,
|
|
cmd.AcceptTosFlag,
|
|
}),
|
|
Before: func(cliCtx *cli.Context) error {
|
|
if err := cmd.LoadFlagsFromConfig(cliCtx, cliCtx.Command.Flags); err != nil {
|
|
return err
|
|
}
|
|
return tos.VerifyTosAcceptedOrPrompt(cliCtx)
|
|
},
|
|
Action: func(cliCtx *cli.Context) error {
|
|
if err := features.ConfigureValidator(cliCtx); err != nil {
|
|
return err
|
|
}
|
|
err := importSlashingProtectionJSON(cliCtx)
|
|
if err != nil {
|
|
logrus.Fatalf("Could not import slashing protection cli: %v", err)
|
|
}
|
|
return nil
|
|
},
|
|
},
|
|
},
|
|
}
|