version

package
v0.5.1-t2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package version holds the build metadata that identifies an uptickd binary.

It exists in this module, rather than relying on the SDK's package alone, because the JSON-RPC endpoint `web3_clientVersion` does not read the SDK's variables. That endpoint is served by the cosmos/evm `web3` namespace, which formats github.com/cosmos/evm/version.Version() -- and nothing in this repository injected anything into that package: not the Makefile, not .goreleaser.yml, not the rbuilder image. Every release node therefore answered `web3_clientVersion` with "Version dev ()\nCompiled at using Go <version>", so the version number, the commit and the build time were all missing, and two nodes built from different commits could not be told apart by a client.

The fix has two halves and both are load-bearing:

  • the build injects AppVersion/GitCommit/BuildDate here (Makefile ldflags, .goreleaser.yml), and
  • Sync publishes them to the cosmos/evm package, i.e. to the variables the endpoint actually renders. One injected package plus one bridge is deliberate: injecting the cosmos/evm symbols directly would spread the same three symbols over every build configuration instead.

A build that bypasses the release pipeline (`go build ./cmd/uptickd`, `go run`) is still identifiable: Go stamps the VCS revision into the binary, and fillFromBuildInfo reports it as the commit.

Index

Constants

This section is empty.

Variables

View Source
var (
	AppVersion = ""
	GitCommit  = ""
	BuildDate  = ""
)

Set by the build with -ldflags -X; see the Makefile and .goreleaser.yml. The names are part of the build contract -- renaming one silently disables its injection, because -X on an unknown symbol is not an error.

Functions

func Sync added in v0.5.0

func Sync()

Sync publishes this package's build metadata to the cosmos/evm version package, which is what the JSON-RPC endpoint `web3_clientVersion` renders.

It runs from init() and is called again explicitly from the CLI entry point (cmd/uptickd/root.go): init() only executes while this package is linked, so the explicit call is what keeps the bridge from disappearing together with an import someone tidies away. Sync is idempotent, and a field is only copied when this package has a value for it, so an injection straight into the cosmos/evm variables still wins when this package is not the injected one.

func Version

func Version() string

Version returns the string that identifies this binary, and it is the same string the JSON-RPC endpoint `web3_clientVersion` serves. It deliberately delegates to the cosmos/evm renderer instead of defining a second format here: two renderers would eventually disagree, and the endpoint is the surface operators actually read.

Types

This section is empty.

Jump to

Keyboard shortcuts

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