mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-26 05:17:22 +00:00
d077483577
* v3 import renamings * tidy * fmt * rev * Update beacon-chain/core/epoch/precompute/reward_penalty_test.go * Update beacon-chain/core/helpers/validators_test.go * Update beacon-chain/db/alias.go * Update beacon-chain/db/alias.go * Update beacon-chain/db/alias.go * Update beacon-chain/db/iface/BUILD.bazel * Update beacon-chain/db/kv/kv.go * Update beacon-chain/db/kv/state.go * Update beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go * Update beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go * Update beacon-chain/sync/initial-sync/service.go * fix deps * fix bad replacements * fix bad replacements * change back * gohashtree version * fix deps Co-authored-by: Nishant Das <nishdas93@gmail.com> Co-authored-by: Potuz <potuz@prysmaticlabs.com>
77 lines
2.3 KiB
Go
77 lines
2.3 KiB
Go
package historycmd
|
|
|
|
import (
|
|
"github.com/prysmaticlabs/prysm/v3/cmd"
|
|
"github.com/prysmaticlabs/prysm/v3/cmd/validator/flags"
|
|
"github.com/prysmaticlabs/prysm/v3/config/features"
|
|
"github.com/prysmaticlabs/prysm/v3/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,
|
|
features.SepoliaTestnet,
|
|
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,
|
|
features.SepoliaTestnet,
|
|
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
|
|
},
|
|
},
|
|
},
|
|
}
|