From 0115497f64dbc0944fe6f2e4e2565ee969e17c49 Mon Sep 17 00:00:00 2001 From: frrist Date: Mon, 6 May 2019 12:34:14 -0400 Subject: [PATCH] add filecoin version to inspect all output --- commands/inspector.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/commands/inspector.go b/commands/inspector.go index 8442e773a3..8c4d54ae5b 100644 --- a/commands/inspector.go +++ b/commands/inspector.go @@ -9,6 +9,7 @@ import ( sysi "github.com/whyrusleeping/go-sysinfo" "github.com/filecoin-project/go-filecoin/config" + "github.com/filecoin-project/go-filecoin/flags" "github.com/filecoin-project/go-filecoin/repo" ) @@ -49,6 +50,7 @@ Prints out information about filecoin process and its environment. allInfo.Memory = mem allInfo.Config = GetInspectorAPI(env).Config() allInfo.Environment = GetInspectorAPI(env).Environment() + allInfo.FilecoinVersion = GetInspectorAPI(env).FilecoinVersion() return cmds.EmitOnce(res, allInfo) }, } @@ -138,11 +140,12 @@ type Inspector struct { // AllInspectorInfo contains all information the inspector can gather. type AllInspectorInfo struct { - Config *config.Config - Runtime *RuntimeInfo - Environment *EnvironmentInfo - Disk *DiskInfo - Memory *MemoryInfo + Config *config.Config + Runtime *RuntimeInfo + Environment *EnvironmentInfo + Disk *DiskInfo + Memory *MemoryInfo + FilecoinVersion string } // RuntimeInfo contains information about the golang runtime. @@ -245,3 +248,8 @@ func (g *Inspector) Memory() (*MemoryInfo, error) { func (g *Inspector) Config() *config.Config { return g.repo.Config() } + +// FilecoinVersion returns the version of go-filecoin. +func (g *Inspector) FilecoinVersion() string { + return flags.Commit +}