Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
24b9860c
Commit
24b9860c
authored
Apr 05, 2017
by
Péter Szilágyi
Committed by
Felix Lange
Apr 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/geth, node: surface geth architecture into version (#13866)
parent
cc303017
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
5 deletions
+8
-5
consolecmd_test.go
cmd/geth/consolecmd_test.go
+4
-2
misccmd.go
cmd/geth/misccmd.go
+2
-1
config.go
node/config.go
+1
-1
node.go
node/node.go
+1
-1
No files found.
cmd/geth/consolecmd_test.go
View file @
24b9860c
...
...
@@ -45,6 +45,7 @@ func TestConsoleWelcome(t *testing.T) {
// Gather all the infos the welcome message needs to contain
geth
.
setTemplateFunc
(
"goos"
,
func
()
string
{
return
runtime
.
GOOS
})
geth
.
setTemplateFunc
(
"goarch"
,
func
()
string
{
return
runtime
.
GOARCH
})
geth
.
setTemplateFunc
(
"gover"
,
runtime
.
Version
)
geth
.
setTemplateFunc
(
"gethver"
,
func
()
string
{
return
params
.
Version
})
geth
.
setTemplateFunc
(
"niltime"
,
func
()
string
{
return
time
.
Unix
(
0
,
0
)
.
Format
(
time
.
RFC1123
)
})
...
...
@@ -58,7 +59,7 @@ func TestConsoleWelcome(t *testing.T) {
geth
.
expect
(
`
Welcome to the Geth JavaScript console!
instance: Geth/v{{gethver}}/{{goos}}/{{gover}}
instance: Geth/v{{gethver}}/{{goos}}
-{{goarch}}
/{{gover}}
coinbase: {{.Etherbase}}
at block: 0 ({{niltime}})
datadir: {{.Datadir}}
...
...
@@ -131,6 +132,7 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint string) {
// Gather all the infos the welcome message needs to contain
attach
.
setTemplateFunc
(
"goos"
,
func
()
string
{
return
runtime
.
GOOS
})
attach
.
setTemplateFunc
(
"goarch"
,
func
()
string
{
return
runtime
.
GOARCH
})
attach
.
setTemplateFunc
(
"gover"
,
runtime
.
Version
)
attach
.
setTemplateFunc
(
"gethver"
,
func
()
string
{
return
params
.
Version
})
attach
.
setTemplateFunc
(
"etherbase"
,
func
()
string
{
return
geth
.
Etherbase
})
...
...
@@ -152,7 +154,7 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint string) {
attach
.
expect
(
`
Welcome to the Geth JavaScript console!
instance: Geth/v{{gethver}}/{{goos}}/{{gover}}
instance: Geth/v{{gethver}}/{{goos}}
-{{goarch}}
/{{gover}}
coinbase: {{etherbase}}
at block: 0 ({{niltime}}){{if ipc}}
datadir: {{datadir}}{{end}}
...
...
cmd/geth/misccmd.go
View file @
24b9860c
...
...
@@ -101,10 +101,11 @@ func version(ctx *cli.Context) error {
if
gitCommit
!=
""
{
fmt
.
Println
(
"Git Commit:"
,
gitCommit
)
}
fmt
.
Println
(
"Architecture:"
,
runtime
.
GOARCH
)
fmt
.
Println
(
"Protocol Versions:"
,
eth
.
ProtocolVersions
)
fmt
.
Println
(
"Network Id:"
,
ctx
.
GlobalInt
(
utils
.
NetworkIdFlag
.
Name
))
fmt
.
Println
(
"Go Version:"
,
runtime
.
Version
())
fmt
.
Println
(
"O
S
:"
,
runtime
.
GOOS
)
fmt
.
Println
(
"O
perating System
:"
,
runtime
.
GOOS
)
fmt
.
Printf
(
"GOPATH=%s
\n
"
,
os
.
Getenv
(
"GOPATH"
))
fmt
.
Printf
(
"GOROOT=%s
\n
"
,
runtime
.
GOROOT
())
return
nil
...
...
node/config.go
View file @
24b9860c
...
...
@@ -266,7 +266,7 @@ func (c *Config) NodeName() string {
if
c
.
Version
!=
""
{
name
+=
"/v"
+
c
.
Version
}
name
+=
"/"
+
runtime
.
GOOS
name
+=
"/"
+
runtime
.
GOOS
+
"-"
+
runtime
.
GOARCH
name
+=
"/"
+
runtime
.
Version
()
return
name
}
...
...
node/node.go
View file @
24b9860c
...
...
@@ -173,7 +173,7 @@ func (n *Node) Start() error {
MaxPendingPeers
:
n
.
config
.
MaxPendingPeers
,
}
running
:=
&
p2p
.
Server
{
Config
:
n
.
serverConfig
}
log
.
Info
(
fmt
.
Sprint
(
"instance:"
,
n
.
serverConfig
.
Name
)
)
log
.
Info
(
"Starting peer-to-peer node"
,
"instance"
,
n
.
serverConfig
.
Name
)
// Otherwise copy and specialize the P2P configuration
services
:=
make
(
map
[
reflect
.
Type
]
Service
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment