/
client.go
56 lines (47 loc) · 1.26 KB
/
client.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
48
49
50
51
52
53
54
55
56
package main
import (
"github.com/spf13/cobra"
stakecmd "github.com/CyberMiles/travis/modules/stake/commands"
"github.com/CyberMiles/travis/sdk/client/commands"
"github.com/CyberMiles/travis/sdk/client/commands/query"
txcmd "github.com/CyberMiles/travis/sdk/client/commands/txs"
)
// clientCmd is the entry point for this binary
var clientCmd = &cobra.Command{
Use: "client",
Short: "Travis light client",
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
},
}
func prepareClientCommands() {
commands.AddBasicFlags(clientCmd)
query.RootCmd.AddCommand(
stakecmd.CmdQueryValidator,
stakecmd.CmdQueryValidators,
stakecmd.CmdQueryDelegator,
stakecmd.CmdQueryAwardInfo,
)
// set up the middleware
txcmd.Middleware = txcmd.Wrappers{}
txcmd.Middleware.Register(txcmd.RootCmd.PersistentFlags())
txcmd.RootCmd.AddCommand(
stakecmd.CmdDeclareCandidacy,
stakecmd.CmdUpdateCandidacy,
stakecmd.CmdWithdrawCandidacy,
stakecmd.CmdVerifyCandidacy,
stakecmd.CmdActivateCandidacy,
stakecmd.CmdDelegate,
stakecmd.CmdWithdraw,
stakecmd.CmdSetCompRate,
stakecmd.CmdUpdateCandidacyAccount,
stakecmd.CmdAcceptCandidacyAccountUpdate,
)
clientCmd.AddCommand(
txcmd.RootCmd,
query.RootCmd,
lineBreak,
commands.InitCmd,
commands.ResetCmd,
)
}