buildinfo

package
v1.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2026 License: Apache-2.0, MIT Imports: 1 Imported by: 0

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.

func UserAgent

func UserAgent() string

UserAgent returns the canonical libp2p user-agent fragment for this build: "lantern/<version>". Suitable for libp2p.UserAgent(...) options.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL