Skip to content

Commit 24b9860

Browse files
karalabefjl
authored andcommitted
cmd/geth, node: surface geth architecture into version (#13866)
1 parent cc30301 commit 24b9860

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

‎cmd/geth/consolecmd_test.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func TestConsoleWelcome(t *testing.T) {
4545

4646
// Gather all the infos the welcome message needs to contain
4747
geth.setTemplateFunc("goos", func() string { return runtime.GOOS })
48+
geth.setTemplateFunc("goarch", func() string { return runtime.GOARCH })
4849
geth.setTemplateFunc("gover", runtime.Version)
4950
geth.setTemplateFunc("gethver", func() string { return params.Version })
5051
geth.setTemplateFunc("niltime", func() string { return time.Unix(0, 0).Format(time.RFC1123) })
@@ -58,7 +59,7 @@ func TestConsoleWelcome(t *testing.T) {
5859
geth.expect(`
5960
Welcome to the Geth JavaScript console!
6061
61-
instance: Geth/v{{gethver}}/{{goos}}/{{gover}}
62+
instance: Geth/v{{gethver}}/{{goos}}-{{goarch}}/{{gover}}
6263
coinbase: {{.Etherbase}}
6364
at block: 0 ({{niltime}})
6465
datadir: {{.Datadir}}
@@ -131,6 +132,7 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint string) {
131132

132133
// Gather all the infos the welcome message needs to contain
133134
attach.setTemplateFunc("goos", func() string { return runtime.GOOS })
135+
attach.setTemplateFunc("goarch", func() string { return runtime.GOARCH })
134136
attach.setTemplateFunc("gover", runtime.Version)
135137
attach.setTemplateFunc("gethver", func() string { return params.Version })
136138
attach.setTemplateFunc("etherbase", func() string { return geth.Etherbase })
@@ -152,7 +154,7 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint string) {
152154
attach.expect(`
153155
Welcome to the Geth JavaScript console!
154156
155-
instance: Geth/v{{gethver}}/{{goos}}/{{gover}}
157+
instance: Geth/v{{gethver}}/{{goos}}-{{goarch}}/{{gover}}
156158
coinbase: {{etherbase}}
157159
at block: 0 ({{niltime}}){{if ipc}}
158160
datadir: {{datadir}}{{end}}

‎cmd/geth/misccmd.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,11 @@ func version(ctx *cli.Context) error {
101101
if gitCommit != "" {
102102
fmt.Println("Git Commit:", gitCommit)
103103
}
104+
fmt.Println("Architecture:", runtime.GOARCH)
104105
fmt.Println("Protocol Versions:", eth.ProtocolVersions)
105106
fmt.Println("Network Id:", ctx.GlobalInt(utils.NetworkIdFlag.Name))
106107
fmt.Println("Go Version:", runtime.Version())
107-
fmt.Println("OS:", runtime.GOOS)
108+
fmt.Println("Operating System:", runtime.GOOS)
108109
fmt.Printf("GOPATH=%s\n", os.Getenv("GOPATH"))
109110
fmt.Printf("GOROOT=%s\n", runtime.GOROOT())
110111
return nil

‎node/config.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ func (c *Config) NodeName() string {
266266
if c.Version != "" {
267267
name += "/v" + c.Version
268268
}
269-
name += "/" + runtime.GOOS
269+
name += "/" + runtime.GOOS + "-" + runtime.GOARCH
270270
name += "/" + runtime.Version()
271271
return name
272272
}

‎node/node.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func (n *Node) Start() error {
173173
MaxPendingPeers: n.config.MaxPendingPeers,
174174
}
175175
running := &p2p.Server{Config: n.serverConfig}
176-
log.Info(fmt.Sprint("instance:", n.serverConfig.Name))
176+
log.Info("Starting peer-to-peer node", "instance", n.serverConfig.Name)
177177

178178
// Otherwise copy and specialize the P2P configuration
179179
services := make(map[reflect.Type]Service)

0 commit comments

Comments
 (0)