diff --git a/cmd/server/main.go b/cmd/server/main.go index f766938..8077751 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -93,7 +93,7 @@ type Options struct { } func main() { - var version = "0.1.1" // set version number + var version = common.Version opts := &Options{} flag.StringVar(&opts.bindAddr, "bind-addr", "127.0.0.1:9069", "the address to listen on") diff --git a/common/version.go b/common/version.go new file mode 100644 index 0000000..4b979c6 --- /dev/null +++ b/common/version.go @@ -0,0 +1,14 @@ +package common + +// Version is the single source of truth for this daemon's version. +// +// It was previously duplicated as a literal in two places that could drift: +// cmd/server/main.go's --version output and the Version field of the LightdInfo +// gRPC reply in frontend/service.go. The gRPC one is the load-bearing copy -- +// it is walletrpc/service.proto:48, so every client and every operator probe +// reads it, and it is the only way to tell from off-box which build a node is +// running. +const Version = "0.1.2" + +// VersionString is what GetLightdInfo advertises to clients. +const VersionString = Version + "-dragonxlightd" diff --git a/frontend/service.go b/frontend/service.go index 10f932c..608cf60 100644 --- a/frontend/service.go +++ b/frontend/service.go @@ -353,7 +353,7 @@ func (s *SqlStreamer) GetLightdInfo(ctx context.Context, in *walletrpc.Empty) (* // TODO these are called Error but they aren't at the moment. // A success will return code 0 and message txhash. return &walletrpc.LightdInfo{ - Version: "0.1.1-dragonxlightd", + Version: common.VersionString, Vendor: "DragonX LightWalletD", TaddrSupport: true, ChainName: chainName,