aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/main.go41
-rw-r--r--cmd/mist/main.go12
2 files changed, 38 insertions, 15 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index 4e5f4c93c..365390a07 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -50,9 +50,20 @@ const (
Version = "0.9.13"
)
-var app = utils.NewApp(Version, "the go-ethereum command line interface")
+var (
+ gitCommit string // set via linker flag
+ nodeNameVersion string
+ app *cli.App
+)
func init() {
+ if gitCommit == "" {
+ nodeNameVersion = Version
+ } else {
+ nodeNameVersion = Version + "-" + gitCommit[:8]
+ }
+
+ app = utils.NewApp(Version, "the go-ethereum command line interface")
app.Action = run
app.HideVersion = true // we have a command to print the version
app.Commands = []cli.Command{
@@ -278,7 +289,7 @@ func main() {
func run(ctx *cli.Context) {
utils.HandleInterrupt()
- cfg := utils.MakeEthConfig(ClientIdentifier, Version, ctx)
+ cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
ethereum, err := eth.New(cfg)
if err != nil {
utils.Fatalf("%v", err)
@@ -290,7 +301,7 @@ func run(ctx *cli.Context) {
}
func console(ctx *cli.Context) {
- cfg := utils.MakeEthConfig(ClientIdentifier, Version, ctx)
+ cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
ethereum, err := eth.New(cfg)
if err != nil {
utils.Fatalf("%v", err)
@@ -305,7 +316,7 @@ func console(ctx *cli.Context) {
}
func execJSFiles(ctx *cli.Context) {
- cfg := utils.MakeEthConfig(ClientIdentifier, Version, ctx)
+ cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
ethereum, err := eth.New(cfg)
if err != nil {
utils.Fatalf("%v", err)
@@ -487,7 +498,7 @@ func exportchain(ctx *cli.Context) {
utils.Fatalf("This command requires an argument.")
}
- cfg := utils.MakeEthConfig(ClientIdentifier, Version, ctx)
+ cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
cfg.SkipBcVersionCheck = true
ethereum, err := eth.New(cfg)
@@ -589,15 +600,17 @@ func makedag(ctx *cli.Context) {
}
func version(c *cli.Context) {
- fmt.Printf(`%v
-Version: %v
-Protocol Version: %d
-Network Id: %d
-GO: %s
-OS: %s
-GOPATH=%s
-GOROOT=%s
-`, ClientIdentifier, Version, c.GlobalInt(utils.ProtocolVersionFlag.Name), c.GlobalInt(utils.NetworkIdFlag.Name), runtime.Version(), runtime.GOOS, os.Getenv("GOPATH"), runtime.GOROOT())
+ fmt.Println(ClientIdentifier)
+ fmt.Println("Version:", Version)
+ if gitCommit != "" {
+ fmt.Println("Git Commit:", gitCommit)
+ }
+ fmt.Println("Protocol Version:", c.GlobalInt(utils.ProtocolVersionFlag.Name))
+ fmt.Println("Network Id:", c.GlobalInt(utils.NetworkIdFlag.Name))
+ fmt.Println("Go Version:", runtime.Version())
+ fmt.Println("OS:", runtime.GOOS)
+ fmt.Printf("GOPATH=%s\n", os.Getenv("GOPATH"))
+ fmt.Printf("GOROOT=%s\n", runtime.GOROOT())
}
// hashish returns true for strings that look like hashes.
diff --git a/cmd/mist/main.go b/cmd/mist/main.go
index 6780cfb3a..1030d6ada 100644
--- a/cmd/mist/main.go
+++ b/cmd/mist/main.go
@@ -41,6 +41,9 @@ const (
)
var (
+ gitCommit string // set via linker flag
+ nodeNameVersion string
+
app = utils.NewApp(Version, "the ether browser")
assetPathFlag = cli.StringFlag{
Name: "asset_path",
@@ -55,6 +58,11 @@ func init() {
if len(rpcCorsFlag.Value) == 0 {
rpcCorsFlag.Value = "http://localhost"
}
+ if gitCommit == "" {
+ nodeNameVersion = Version
+ } else {
+ nodeNameVersion = Version + "-" + gitCommit[:8]
+ }
app.Action = run
app.Flags = []cli.Flag{
@@ -74,6 +82,7 @@ func init() {
utils.RPCPortFlag,
utils.JSpathFlag,
utils.ProtocolVersionFlag,
+ utils.BlockchainVersionFlag,
utils.NetworkIdFlag,
}
}
@@ -106,7 +115,8 @@ func run(ctx *cli.Context) {
tstart := time.Now()
// TODO: show qml popup instead of exiting if initialization fails.
- cfg := utils.MakeEthConfig(ClientIdentifier, Version, ctx)
+ cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
+ cfg.Shh = true
ethereum, err := eth.New(cfg)
if err != nil {
utils.Fatalf("%v", err)