2024-02-01 14:41:44 +00:00
|
|
|
package netmap
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-adm/internal/modules/morph/util"
|
|
|
|
"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) {
|
|
|
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
|
|
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
|
|
|
},
|
|
|
|
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) {
|
|
|
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
|
|
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
|
|
|
},
|
|
|
|
RunE: ForceNewEpochCmd,
|
|
|
|
}
|
|
|
|
)
|
2024-02-01 14:41:44 +00:00
|
|
|
|
|
|
|
func initNetmapCandidatesCmd() {
|
|
|
|
CandidatesCmd.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
|
|
|
}
|
|
|
|
|
2024-02-01 14:59:53 +00:00
|
|
|
func initForceNewEpochCmd() {
|
|
|
|
ForceNewEpoch.Flags().String(util.AlphabetWalletsFlag, "", util.AlphabetWalletsFlagDesc)
|
|
|
|
ForceNewEpoch.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
|
|
|
ForceNewEpoch.Flags().String(util.LocalDumpFlag, "", "Path to the blocks dump file")
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|