-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.go
40 lines (35 loc) · 1.01 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
package main
import (
"flag"
"fmt"
"runtime/debug"
_ "github.com/assetcloud/assetchain/plugin"
"github.com/assetcloud/assetchain/version"
_ "github.com/assetcloud/chain/system"
frameVersion "github.com/assetcloud/chain/common/version"
"github.com/assetcloud/chain/util/cli"
pluginVersion "github.com/assetcloud/plugin/version"
)
var (
percent = flag.Int("p", 0, "SetGCPercent")
versionCmd = flag.Bool("version", false, "assetchain detail version")
)
func main() {
flag.Parse()
if *versionCmd {
fmt.Printf("Build time: %s", version.BuildTime)
fmt.Printf("System version: %s", version.Platform)
fmt.Printf("Golang version: %s", version.GoVersion)
fmt.Printf("assetchain version: %s", version.GetVersion())
fmt.Printf("Chain frame version: %s", frameVersion.GetVersion())
fmt.Printf("Chain plugin version: %s", pluginVersion.GetVersion())
return
}
if *percent < 0 || *percent > 100 {
*percent = 0
}
if *percent > 0 {
debug.SetGCPercent(*percent)
}
cli.RunChain("assetchain", assetchain)
}