2018-05-22 09:22:22 -06:00
|
|
|
package common
|
|
|
|
|
|
|
|
import "runtime"
|
|
|
|
|
|
|
|
var (
|
|
|
|
version = "unknown"
|
|
|
|
gitcommit = "unknown"
|
|
|
|
buildtime = "unknown"
|
|
|
|
)
|
|
|
|
|
2019-01-24 07:24:56 -07:00
|
|
|
// VersionInfo holds information about the running Blockbook instance
|
2018-05-22 09:22:22 -06:00
|
|
|
type VersionInfo struct {
|
|
|
|
Version string `json:"version"`
|
|
|
|
GitCommit string `json:"gitcommit"`
|
|
|
|
BuildTime string `json:"buildtime"`
|
|
|
|
GoVersion string `json:"goversion"`
|
|
|
|
OSArch string `json:"os/arch"`
|
|
|
|
}
|
|
|
|
|
2019-01-24 07:24:56 -07:00
|
|
|
// GetVersionInfo returns VersionInfo of the running Blockbook instance
|
2018-05-22 09:22:22 -06:00
|
|
|
func GetVersionInfo() VersionInfo {
|
|
|
|
return VersionInfo{
|
|
|
|
Version: version,
|
|
|
|
GitCommit: gitcommit,
|
|
|
|
BuildTime: buildtime,
|
|
|
|
GoVersion: runtime.Version(),
|
|
|
|
OSArch: runtime.GOOS + "/" + runtime.GOARCH,
|
|
|
|
}
|
|
|
|
}
|