2019-06-25 11:42:17 +00:00
|
|
|
package build
|
|
|
|
|
2019-12-11 22:00:39 +00:00
|
|
|
var CurrentCommit string
|
2020-06-01 18:43:51 +00:00
|
|
|
var BuildType int
|
|
|
|
|
|
|
|
const (
|
2021-01-20 06:47:27 +00:00
|
|
|
BuildDefault = 0
|
|
|
|
BuildMainnet = 0x1
|
|
|
|
Build2k = 0x2
|
|
|
|
BuildDebug = 0x3
|
|
|
|
BuildCalibnet = 0x4
|
2020-06-01 18:43:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func buildType() string {
|
|
|
|
switch BuildType {
|
|
|
|
case BuildDefault:
|
2020-06-01 19:11:37 +00:00
|
|
|
return ""
|
2021-01-20 06:47:27 +00:00
|
|
|
case BuildMainnet:
|
|
|
|
return "+mainnet"
|
2020-06-01 18:43:51 +00:00
|
|
|
case Build2k:
|
|
|
|
return "+2k"
|
2021-01-20 06:47:27 +00:00
|
|
|
case BuildDebug:
|
|
|
|
return "+debug"
|
|
|
|
case BuildCalibnet:
|
|
|
|
return "+calibnet"
|
2020-06-01 18:43:51 +00:00
|
|
|
default:
|
|
|
|
return "+huh?"
|
|
|
|
}
|
|
|
|
}
|
2019-12-11 22:00:39 +00:00
|
|
|
|
2019-12-17 15:26:16 +00:00
|
|
|
// BuildVersion is the local build version, set by build system
|
2021-02-23 21:24:31 +00:00
|
|
|
const BuildVersion = "1.5.0"
|
2019-07-19 10:15:22 +00:00
|
|
|
|
2020-06-01 18:43:51 +00:00
|
|
|
func UserVersion() string {
|
|
|
|
return BuildVersion + buildType() + CurrentCommit
|
|
|
|
}
|