package version

import "github.com/ethereum/go-ethereum/internal/version"

Package version implements reading of build version information.

Index

Variables

var Family = fmt.Sprintf("%d.%d", version.Major, version.Minor)

Family holds the textual version string for major.minor

var Semantic = fmt.Sprintf("%d.%d.%d", version.Major, version.Minor, version.Patch)

Semantic holds the textual version string for major.minor.patch.

var WithMeta = func() string {
	v := Semantic
	if version.Meta != "" {
		v += "-" + version.Meta
	}
	return v
}()

WithMeta holds the textual version string including the metadata.

Functions

func Archive

func Archive(gitCommit string) string

Archive 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 ClientName

func ClientName(clientIdentifier string) string

ClientName creates a software name/version identifier according to common conventions in the Ethereum p2p network.

func Info

func Info() (version, vcs string)

Info returns build and platform information about the current binary.

If the package that is currently executing is a prefixed by our go-ethereum module path, it will print out commit and date VCS information. Otherwise, it will assume it's imported by a third-party and will return the imported version and whether it was replaced by another module.

func WithCommit

func WithCommit(gitCommit, gitDate string) string

Types

type VCSInfo

type VCSInfo struct {
	Commit string // head commit hash
	Date   string // commit time in YYYYMMDD format
	Dirty  bool
}

VCSInfo represents the git repository state.

func VCS

func VCS() (VCSInfo, bool)

VCS returns version control information of the current executable.

Source Files

vcs.go version.go

Version
v1.15.11 (latest)
Published
May 5, 2025
Platform
linux/amd64
Imports
6 packages
Last checked
2 days ago

Tools for package owners.