github.com/iotexproject/iotex-core@v1.14.1-rc1/ioctl/newcmd/node/node.go (about) 1 package node 2 3 import ( 4 "github.com/spf13/cobra" 5 6 "github.com/iotexproject/iotex-core/ioctl" 7 "github.com/iotexproject/iotex-core/ioctl/config" 8 ) 9 10 // Multi-language support 11 var ( 12 _nodeCmdShorts = map[config.Language]string{ 13 config.English: "Deal with nodes of IoTeX blockchain", 14 config.Chinese: "处理IoTeX区块链的节点", 15 } 16 ) 17 18 // NewNodeCmd represents the new node command. 19 func NewNodeCmd(client ioctl.Client) *cobra.Command { 20 nodeShorts, _ := client.SelectTranslation(_nodeCmdShorts) 21 22 nc := &cobra.Command{ 23 Use: "node", 24 Short: nodeShorts, 25 } 26 nc.AddCommand(NewNodeDelegateCmd(client)) 27 nc.AddCommand(NewNodeRewardCmd(client)) 28 nc.AddCommand(NewNodeProbationlistCmd(client)) 29 30 client.SetEndpointWithFlag(nc.PersistentFlags().StringVar) 31 client.SetInsecureWithFlag(nc.PersistentFlags().BoolVar) 32 return nc 33 }