Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add filecoin version to inspect all output #2725

Merged
merged 7 commits into from
May 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions commands/inspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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)
},
}
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
}