2024-02-01 14:41:44 +00:00
|
|
|
package netmap
|
|
|
|
|
|
|
|
import (
|
2024-02-02 12:04:48 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-adm/internal/commonflags"
|
2024-02-01 14:41:44 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/spf13/viper"
|
|
|
|
)
|
|
|
|
|
2024-02-01 14:59:53 +00:00
|
|
|
var (
|
|
|
|
CandidatesCmd = &cobra.Command{
|
|
|
|
Use: "netmap-candidates",
|
|
|
|
Short: "List netmap candidates nodes",
|
|
|
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
2024-02-02 12:04:48 +00:00
|
|
|
_ = viper.BindPFlag(commonflags.EndpointFlag, cmd.Flags().Lookup(commonflags.EndpointFlag))
|
|
|
|
_ = viper.BindPFlag(commonflags.AlphabetWalletsFlag, cmd.Flags().Lookup(commonflags.AlphabetWalletsFlag))
|
2024-02-01 14:59:53 +00:00
|
|
|
},
|
|
|
|
Run: listNetmapCandidatesNodes,
|
|
|
|
}
|
|
|
|
ForceNewEpoch = &cobra.Command{
|
|
|
|
Use: "force-new-epoch",
|
|
|
|
Short: "Create new FrostFS epoch event in the side chain",
|
|
|
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
2024-02-02 12:04:48 +00:00
|
|
|
_ = viper.BindPFlag(commonflags.AlphabetWalletsFlag, cmd.Flags().Lookup(commonflags.AlphabetWalletsFlag))
|
|
|
|
_ = viper.BindPFlag(commonflags.EndpointFlag, cmd.Flags().Lookup(commonflags.EndpointFlag))
|
2024-09-18 15:14:54 +00:00
|
|
|
_ = viper.BindPFlag(commonflags.DeltaFlag, cmd.Flags().Lookup(commonflags.DeltaFlag))
|
2024-02-01 14:59:53 +00:00
|
|
|
},
|
|
|
|
RunE: ForceNewEpochCmd,
|
|
|
|
}
|
|
|
|
)
|
2024-02-01 14:41:44 +00:00
|
|
|
|
|
|
|
func initNetmapCandidatesCmd() {
|
2024-02-02 12:04:48 +00:00
|
|
|
CandidatesCmd.Flags().StringP(commonflags.EndpointFlag, commonflags.EndpointFlagShort, "", commonflags.EndpointFlagDesc)
|
2024-02-01 14:41:44 +00:00
|
|
|
}
|
|
|
|
|
2024-02-01 14:59:53 +00:00
|
|
|
func initForceNewEpochCmd() {
|
2024-02-02 12:04:48 +00:00
|
|
|
ForceNewEpoch.Flags().String(commonflags.AlphabetWalletsFlag, "", commonflags.AlphabetWalletsFlagDesc)
|
|
|
|
ForceNewEpoch.Flags().StringP(commonflags.EndpointFlag, commonflags.EndpointFlagShort, "", commonflags.EndpointFlagDesc)
|
|
|
|
ForceNewEpoch.Flags().String(commonflags.LocalDumpFlag, "", "Path to the blocks dump file")
|
2024-09-18 15:14:54 +00:00
|
|
|
ForceNewEpoch.Flags().Int64(commonflags.DeltaFlag, 1, "Number of epochs to increase the current epoch")
|
2024-02-01 14:59:53 +00:00
|
|
|
}
|
|
|
|
|
2024-02-01 14:41:44 +00:00
|
|
|
func init() {
|
|
|
|
initNetmapCandidatesCmd()
|
2024-02-01 14:59:53 +00:00
|
|
|
initForceNewEpochCmd()
|
2024-02-01 14:41:44 +00:00
|
|
|
}
|