-
Notifications
You must be signed in to change notification settings - Fork 33
/
main.go
41 lines (34 loc) · 1.23 KB
/
main.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
package main
import (
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/version"
hubtypes "github.com/sentinel-official/hub/types"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/sentinel-official/dvpn-node/cmd"
v2ray "github.com/sentinel-official/dvpn-node/services/v2ray/cli"
wireguard "github.com/sentinel-official/dvpn-node/services/wireguard/cli"
"github.com/sentinel-official/dvpn-node/types"
)
func main() {
hubtypes.GetConfig().Seal()
root := &cobra.Command{
Use: "sentinelnode",
SilenceUsage: true,
}
root.AddCommand(
cmd.ConfigCmd(),
cmd.KeysCmd(),
v2ray.Command(),
wireguard.Command(),
cmd.StartCmd(),
version.NewVersionCommand(),
)
root.PersistentFlags().String(flags.FlagHome, types.DefaultHomeDirectory, "home directory")
root.PersistentFlags().String(flags.FlagLogFormat, "plain", "log format")
root.PersistentFlags().String(flags.FlagLogLevel, "info", "log level")
_ = viper.BindPFlag(flags.FlagHome, root.PersistentFlags().Lookup(flags.FlagHome))
_ = viper.BindPFlag(flags.FlagLogFormat, root.PersistentFlags().Lookup(flags.FlagLogFormat))
_ = viper.BindPFlag(flags.FlagLogLevel, root.PersistentFlags().Lookup(flags.FlagLogLevel))
_ = root.Execute()
}