-
Notifications
You must be signed in to change notification settings - Fork 321
/
node.go
47 lines (41 loc) · 1.68 KB
/
node.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2022 IoTeX Foundation
// This source code is provided 'as is' and no warranties are given as to title or non-infringement, merchantability
// or fitness for purpose and, to the extent permitted by law, all liability for your use of the code is disclaimed.
// This source code is governed by Apache License 2.0 that can be found in the LICENSE file.
package node
import (
"github.com/spf13/cobra"
"github.com/iotexproject/iotex-core/ioctl/config"
"github.com/iotexproject/iotex-core/ioctl/flag"
)
// Multi-language support
var (
_nodeCmdShorts = map[config.Language]string{
config.English: "Deal with nodes of IoTeX blockchain",
config.Chinese: "处理IoTeX区块链的节点",
}
_flagEndpointUsages = map[config.Language]string{
config.English: "set endpoint for once",
config.Chinese: "一次设置端点",
}
_flagInsecureUsages = map[config.Language]string{
config.English: "insecure connection for once",
config.Chinese: "一次不安全的连接",
}
_allFlag = flag.BoolVarP("all", "a", false, "returns all delegates")
)
// NodeCmd represents the node command
var NodeCmd = &cobra.Command{
Use: "node",
Short: config.TranslateInLang(_nodeCmdShorts, config.UILanguage),
}
func init() {
NodeCmd.AddCommand(_nodeDelegateCmd)
NodeCmd.AddCommand(_nodeRewardCmd)
NodeCmd.AddCommand(_nodeProbationlistCmd)
NodeCmd.PersistentFlags().StringVar(&config.ReadConfig.Endpoint, "endpoint",
config.ReadConfig.Endpoint, config.TranslateInLang(_flagEndpointUsages, config.UILanguage))
NodeCmd.PersistentFlags().BoolVar(&config.Insecure, "insecure", config.Insecure,
config.TranslateInLang(_flagInsecureUsages, config.UILanguage))
_allFlag.RegisterCommand(_nodeDelegateCmd)
}