-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
39 lines (31 loc) · 869 Bytes
/
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
package main
import (
"angine-demo/node"
"path"
"flag"
acfg "gitlab.zhonganonline.com/ann/angine/config"
"gitlab.zhonganonline.com/ann/ann-module/lib/go-config"
"gitlab.zhonganonline.com/ann/civilwar/src/chain/log"
)
// NodeNum for angine prevote
const (
root = "/home/vagrant/gohome/src/angine-demo/"
logpath = root + "log/"
)
// DataDirFlag set seed direction
var (
DataDirFlag = flag.String("datadir", "seed0", "set seed data dir")
InitSeedFlag = flag.Bool("init", false, "new config files")
annConf *config.MapConfig
)
func main() {
flag.Parse()
annConf = acfg.GetConfig(root + *DataDirFlag)
env := annConf.GetString("environment")
logger := log.Initialize(env, path.Join(logpath, "node.output.log"), path.Join(logpath, "node.err.log"))
if *InitSeedFlag == true {
node.Initfiles(annConf)
} else {
node.RunNode(logger, annConf)
}
}