2022-05-23 16:26:27 +00:00
|
|
|
package control
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/commonflags"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/spf13/viper"
|
|
|
|
)
|
|
|
|
|
|
|
|
var Cmd = &cobra.Command{
|
|
|
|
Use: "control",
|
|
|
|
Short: "Operations with storage node",
|
|
|
|
Long: `Operations with storage node`,
|
|
|
|
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
|
|
|
ff := cmd.Flags()
|
|
|
|
|
|
|
|
_ = viper.BindPFlag(commonflags.WalletPath, ff.Lookup(commonflags.WalletPath))
|
|
|
|
_ = viper.BindPFlag(commonflags.Account, ff.Lookup(commonflags.Account))
|
|
|
|
_ = viper.BindPFlag(controlRPC, ff.Lookup(controlRPC))
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
const (
|
|
|
|
controlRPC = "endpoint"
|
|
|
|
controlRPCDefault = ""
|
2022-10-11 14:02:03 +00:00
|
|
|
controlRPCUsage = "Remote node control address (as 'multiaddr' or '<host>:<port>')"
|
2022-05-23 16:26:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
Cmd.AddCommand(
|
|
|
|
healthCheckCmd,
|
|
|
|
setNetmapStatusCmd,
|
|
|
|
dropObjectsCmd,
|
|
|
|
shardsCmd,
|
2022-05-16 16:43:29 +00:00
|
|
|
synchronizeTreeCmd,
|
2022-05-23 16:26:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
initControlHealthCheckCmd()
|
|
|
|
initControlSetNetmapStatusCmd()
|
|
|
|
initControlDropObjectsCmd()
|
|
|
|
initControlShardsCmd()
|
2022-05-16 16:43:29 +00:00
|
|
|
initControlSynchronizeTreeCmd()
|
2022-05-23 16:26:27 +00:00
|
|
|
}
|