/
pier.go
52 lines (45 loc) · 920 Bytes
/
pier.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
package main
import (
"fmt"
"os"
"time"
"github.com/fatih/color"
"github.com/meshplus/bitxhub-kit/log"
"github.com/meshplus/pier"
"github.com/urfave/cli"
)
var logger = log.NewWithModule("cmd")
func main() {
app := cli.NewApp()
app.Name = "Pier"
app.Usage = "A Gateway Used To Cross the Appchain"
app.Compiled = time.Now()
app.Version = fmt.Sprintf("Pier version: %s-%s-%s\n", pier.CurrentVersion, pier.CurrentBranch, pier.CurrentCommit)
// global flags
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "repo",
Usage: "Pier repository path",
},
cli.BoolFlag{
Name: "tls",
Usage: "enable tls between pier and bitxhub or not",
},
}
app.Commands = []cli.Command{
appchainBxhCMD,
//client.LoadClientCMD(),
idCMD,
initCMD,
networkCMD,
p2pCMD,
pluginCMD,
startCMD,
versionCMD,
}
err := app.Run(os.Args)
if err != nil {
color.Red(err.Error())
os.Exit(-1)
}
}