lotus/build/version.go

37 lines
611 B
Go
Raw Normal View History

package build
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?"
}
}
// BuildVersion is the local build version, set by build system
2021-03-29 23:41:47 +00:00
const BuildVersion = "1.7.0-dev"
2020-06-01 18:43:51 +00:00
func UserVersion() string {
return BuildVersion + buildType() + CurrentCommit
}