aboutsummaryrefslogtreecommitdiffstats
path: root/params
diff options
context:
space:
mode:
Diffstat (limited to 'params')
-rw-r--r--params/version.go23
1 files changed, 21 insertions, 2 deletions
diff --git a/params/version.go b/params/version.go
index c4d83f0a4..433042096 100644
--- a/params/version.go
+++ b/params/version.go
@@ -29,15 +29,34 @@ const (
// Version holds the textual version string.
var Version = func() string {
- v := fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch)
+ return fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch)
+}()
+
+// VersionWithMeta holds the textual version string including the metadata.
+var VersionWithMeta = func() string {
+ v := Version
if VersionMeta != "" {
v += "-" + VersionMeta
}
return v
}()
-func VersionWithCommit(gitCommit string) string {
+// ArchiveVersion holds the textual version string used for Geth archives.
+// e.g. "1.8.11-dea1ce05" for stable releases, or
+// "1.8.13-unstable-21c059b6" for unstable releases
+func ArchiveVersion(gitCommit string) string {
vsn := Version
+ if VersionMeta != "stable" {
+ vsn += "-" + VersionMeta
+ }
+ if len(gitCommit) >= 8 {
+ vsn += "-" + gitCommit[:8]
+ }
+ return vsn
+}
+
+func VersionWithCommit(gitCommit string) string {
+ vsn := VersionWithMeta
if len(gitCommit) >= 8 {
vsn += "-" + gitCommit[:8]
}