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))
|
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-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-10-02 08:20:09 +00:00
|
|
|
ForceNewEpoch.Flags().Int64(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
|
|
|
}
|