diff --git a/config.go b/config.go index f39099e1..26e4c522 100644 --- a/config.go +++ b/config.go @@ -21,6 +21,7 @@ import ( "github.com/btcsuite/btcutil" flags "github.com/jessevdk/go-flags" + "github.com/lightningnetwork/lnd/build" "github.com/lightningnetwork/lnd/htlcswitch/hodl" "github.com/lightningnetwork/lnd/lncfg" "github.com/lightningnetwork/lnd/lnwire" @@ -323,7 +324,7 @@ func loadConfig() (*config, error) { appName = strings.TrimSuffix(appName, filepath.Ext(appName)) usageMessage := fmt.Sprintf("Use %s -h to show usage", appName) if preCfg.ShowVersion { - fmt.Println(appName, "version", version()) + fmt.Println(appName, "version", build.Version()) os.Exit(0) } diff --git a/lnd.go b/lnd.go index f7dba152..93b58ef1 100644 --- a/lnd.go +++ b/lnd.go @@ -37,6 +37,8 @@ import ( "github.com/btcsuite/btcwallet/wallet" proxy "github.com/grpc-ecosystem/grpc-gateway/runtime" flags "github.com/jessevdk/go-flags" + + "github.com/lightningnetwork/lnd/build" "github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/keychain" "github.com/lightningnetwork/lnd/lncfg" @@ -54,10 +56,6 @@ const ( ) var ( - // Commit stores the current commit hash of this build. This should be - // set using -ldflags during compilation. - Commit string - cfg *config registeredChains = newChainRegistry() @@ -108,7 +106,8 @@ func lndMain() error { }() // Show version at startup. - ltndLog.Infof("Version %s", version()) + ltndLog.Infof("Version: %s, build=%s, logging=%s", + build.Version(), build.Deployment, build.LoggingType) var network string switch { diff --git a/rpcserver.go b/rpcserver.go index 24984c4f..85043408 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -24,6 +24,7 @@ import ( "github.com/btcsuite/btcwallet/waddrmgr" "github.com/coreos/bbolt" "github.com/davecgh/go-spew/spew" + "github.com/lightningnetwork/lnd/build" "github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/htlcswitch" "github.com/lightningnetwork/lnd/lnrpc" @@ -1364,7 +1365,7 @@ func (r *rpcServer) GetInfo(ctx context.Context, Uris: uris, Alias: nodeAnn.Alias.String(), BestHeaderTimestamp: int64(bestHeaderTimestamp), - Version: version(), + Version: build.Version(), }, nil }