mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loop: add the commit_hash to GetInfoResponse, change version semantics
With this commit we extend GetinfoResponse with the strict commit hash (which also includes whether the build tree was clean or dirty).
This commit is contained in:
parent
f72cdde58f
commit
9a6266f9f7
7 changed files with 725 additions and 692 deletions
|
|
@ -162,7 +162,7 @@ func fatal(err error) {
|
|||
func main() {
|
||||
app := cli.NewApp()
|
||||
|
||||
app.Version = loop.Version()
|
||||
app.Version = loop.RichVersion()
|
||||
app.Name = "loop"
|
||||
app.Usage = "control plane for your loopd"
|
||||
app.Flags = []cli.Flag{
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ func Run(rpcCfg RPCConfig) error {
|
|||
appName := filepath.Base(os.Args[0])
|
||||
appName = strings.TrimSuffix(appName, filepath.Ext(appName))
|
||||
if config.ShowVersion {
|
||||
fmt.Println(appName, "version", loop.Version())
|
||||
fmt.Println(appName, "version", loop.RichVersion())
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
|
|
@ -222,7 +222,7 @@ func Run(rpcCfg RPCConfig) error {
|
|||
}
|
||||
|
||||
// Print the version before executing either primary directive.
|
||||
infof("Version: %v", loop.Version())
|
||||
infof("Version: %v", loop.RichVersion())
|
||||
|
||||
lisCfg := NewListenerConfig(&config, rpcCfg)
|
||||
|
||||
|
|
|
|||
|
|
@ -1210,6 +1210,7 @@ func (s *swapClientServer) GetInfo(ctx context.Context,
|
|||
|
||||
return &looprpc.GetInfoResponse{
|
||||
Version: loop.Version(),
|
||||
CommitHash: loop.CommitHash(),
|
||||
Network: s.config.Network,
|
||||
RpcListen: s.config.RPCListen,
|
||||
RestListen: s.config.RESTListen,
|
||||
|
|
|
|||
1385
looprpc/client.pb.go
1385
looprpc/client.pb.go
File diff suppressed because it is too large
Load diff
|
|
@ -1045,6 +1045,11 @@ message GetInfoResponse {
|
|||
Statistics about loop ins.
|
||||
*/
|
||||
LoopStats loop_in_stats = 8;
|
||||
|
||||
/*
|
||||
The git commit hash of the loopd binary.
|
||||
*/
|
||||
string commit_hash = 9;
|
||||
}
|
||||
|
||||
message GetLiquidityParamsRequest {
|
||||
|
|
|
|||
|
|
@ -967,6 +967,10 @@
|
|||
"loop_in_stats": {
|
||||
"$ref": "#/definitions/looprpcLoopStats",
|
||||
"description": "Statistics about loop ins."
|
||||
},
|
||||
"commit_hash": {
|
||||
"type": "string",
|
||||
"description": "The git commit hash of the loopd binary."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
16
version.go
16
version.go
|
|
@ -45,13 +45,25 @@ const (
|
|||
var AgentName = defaultAgentName
|
||||
|
||||
// Version returns the application version as a properly formed string per the
|
||||
// semantic versioning 2.0.0 spec (http://semver.org/) and the commit it was
|
||||
// built on.
|
||||
// semantic versioning 2.0.0 spec (http://semver.org/).
|
||||
func Version() string {
|
||||
// Append commit hash of current build to version.
|
||||
return semanticVersion()
|
||||
}
|
||||
|
||||
// RichVersion returns the application version as a properly formed string
|
||||
// per the semantic versioning 2.0.0 spec (http://semver.org/) and the commit
|
||||
// it was built on.
|
||||
func RichVersion() string {
|
||||
// Append commit hash of current build to version.
|
||||
return fmt.Sprintf("%s commit=%s", semanticVersion(), Commit)
|
||||
}
|
||||
|
||||
// CommitHash returns the commit hash of the current build.
|
||||
func CommitHash() string {
|
||||
return Commit
|
||||
}
|
||||
|
||||
// UserAgent returns the full user agent string that identifies the software
|
||||
// that is submitting swaps to the loop server.
|
||||
func UserAgent(initiator string) string {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue