Documentation
¶
Overview ¶
Package buildinfo exposes the Lantern build identity (version + network) so callers (RPC handlers, CLI version subcommand, beacons) don't need to import package main.
The version string is baked at release time via:
-ldflags "-X main.versionTag=v1.2.1"
in cmd/lantern/main.go, then propagated here at startup via SetVersion. When SetVersion isn't called (e.g. tests, library use) we fall back to the const defaultVersion below.
The "Lantern+<network>" format is intentional: it's how clients (Curio's `Filecoin.Version` probe in particular) tell apart a Lantern light node from a Lotus full node without ambiguous compat suffixes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildVersion ¶
func BuildVersion() string
BuildVersion returns the current build's version tag, e.g. "v1.2.1". When SetVersion was never called or was called with "", returns "dev".
func Network ¶
func Network() string
Network returns the active Filecoin network name. Defaults to "mainnet".
func SetNetwork ¶
func SetNetwork(n string)
SetNetwork records the active Filecoin network. Defaults to "mainnet" when unset. Reserved for calibration support.
func SetVersion ¶
func SetVersion(v string)
SetVersion records the live build version. Called by cmd/lantern/main.go at startup, passing the ldflags-injected versionTag. An empty string is treated as "not set" and BuildVersion falls back to defaultVersion.
Types ¶
This section is empty.