43 lines
1.4 KiB
Go
43 lines
1.4 KiB
Go
package netmap
|
|
|
|
import (
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-adm/internal/modules/morph/util"
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
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,
|
|
}
|
|
)
|
|
|
|
func initNetmapCandidatesCmd() {
|
|
CandidatesCmd.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
|
}
|
|
|
|
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")
|
|
}
|
|
|
|
func init() {
|
|
initNetmapCandidatesCmd()
|
|
initForceNewEpochCmd()
|
|
}
|