Alexander Chuprov
945b7c740b
All checks were successful
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m47s
Tests and linters / Run gofumpt (pull_request) Successful in 3m59s
Tests and linters / gopls check (pull_request) Successful in 4m8s
Build / Build Components (pull_request) Successful in 4m31s
Vulncheck / Vulncheck (pull_request) Successful in 4m29s
Tests and linters / Staticcheck (pull_request) Successful in 5m3s
Tests and linters / Lint (pull_request) Successful in 5m23s
Tests and linters / Tests with -race (pull_request) Successful in 7m25s
DCO action / DCO (pull_request) Successful in 1m6s
Tests and linters / Tests (pull_request) Successful in 2m40s
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
45 lines
1.7 KiB
Go
45 lines
1.7 KiB
Go
package netmap
|
|
|
|
import (
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-adm/internal/commonflags"
|
|
"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(commonflags.EndpointFlag, cmd.Flags().Lookup(commonflags.EndpointFlag))
|
|
_ = viper.BindPFlag(commonflags.AlphabetWalletsFlag, cmd.Flags().Lookup(commonflags.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(commonflags.AlphabetWalletsFlag, cmd.Flags().Lookup(commonflags.AlphabetWalletsFlag))
|
|
_ = viper.BindPFlag(commonflags.EndpointFlag, cmd.Flags().Lookup(commonflags.EndpointFlag))
|
|
_ = viper.BindPFlag(commonflags.DeltaFlag, cmd.Flags().Lookup(commonflags.DeltaFlag))
|
|
},
|
|
RunE: ForceNewEpochCmd,
|
|
}
|
|
)
|
|
|
|
func initNetmapCandidatesCmd() {
|
|
CandidatesCmd.Flags().StringP(commonflags.EndpointFlag, commonflags.EndpointFlagShort, "", commonflags.EndpointFlagDesc)
|
|
}
|
|
|
|
func initForceNewEpochCmd() {
|
|
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")
|
|
ForceNewEpoch.Flags().Int64(commonflags.DeltaFlag, 1, "Number of epochs to increase the current epoch")
|
|
}
|
|
|
|
func init() {
|
|
initNetmapCandidatesCmd()
|
|
initForceNewEpochCmd()
|
|
}
|