Files
zeekayandHanzo Dev c935ee4e3a The image builds the daemon it ships
This stage ran ./scripts/build.sh. There is no scripts directory in
this repository and there never was one here, so the image could not be
built at all — every attempt failed naming a file nobody had written,
and the only luxd anyone could run was one built by hand.

It runs the same command the Makefile does, and then runs the binary
once: a build that produces something which will not start is a build
that failed later.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-08 03:18:19 -07:00

46 lines
1.4 KiB
Go

// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package version
import (
"fmt"
"runtime"
"strings"
)
// GitCommit is stamped by the build with -ldflags at compile time
var GitCommit string
// Versions contains the versions relevant to a build of node. In
// addition to supporting construction of the string displayed by
// --version, it is used to produce the output of --version-json and can
// be used to unmarshal that output.
type Versions struct {
Application string `json:"application"`
Database string `json:"database"`
RPCChainVM uint64 `json:"rpcchainvm"`
// Commit may be empty if GitCommit was not set at compile time
Commit string `json:"commit"`
Go string `json:"go"`
}
func GetVersions() *Versions {
return &Versions{
Application: CurrentApp.String(),
Database: CurrentDatabase.String(),
RPCChainVM: uint64(RPCChainVMProtocol),
Commit: GitCommit,
Go: strings.TrimPrefix(runtime.Version(), "go"),
}
}
func (v *Versions) String() string {
// This format maintains consistency with previous --version output
versionString := fmt.Sprintf("%s [database=%s, rpcchainvm=%d, ", v.Application, v.Database, v.RPCChainVM)
if len(v.Commit) > 0 {
versionString += fmt.Sprintf("commit=%s, ", v.Commit)
}
return versionString + fmt.Sprintf("go=%s]", v.Go)
}