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
eb5e4302
Commit
eb5e4302
authored
Apr 28, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/geth, cmd/mist: use gitCommit in node name
parent
71c28cfb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
15 deletions
+36
-15
main.go
cmd/geth/main.go
+27
-14
main.go
cmd/mist/main.go
+9
-1
No files found.
cmd/geth/main.go
View file @
eb5e4302
...
@@ -50,9 +50,20 @@ const (
...
@@ -50,9 +50,20 @@ const (
Version
=
"0.9.12"
Version
=
"0.9.12"
)
)
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
()
{
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
.
Action
=
run
app
.
HideVersion
=
true
// we have a command to print the version
app
.
HideVersion
=
true
// we have a command to print the version
app
.
Commands
=
[]
cli
.
Command
{
app
.
Commands
=
[]
cli
.
Command
{
...
@@ -278,7 +289,7 @@ func main() {
...
@@ -278,7 +289,7 @@ func main() {
func
run
(
ctx
*
cli
.
Context
)
{
func
run
(
ctx
*
cli
.
Context
)
{
utils
.
HandleInterrupt
()
utils
.
HandleInterrupt
()
cfg
:=
utils
.
MakeEthConfig
(
ClientIdentifier
,
Version
,
ctx
)
cfg
:=
utils
.
MakeEthConfig
(
ClientIdentifier
,
nodeName
Version
,
ctx
)
ethereum
,
err
:=
eth
.
New
(
cfg
)
ethereum
,
err
:=
eth
.
New
(
cfg
)
if
err
!=
nil
{
if
err
!=
nil
{
utils
.
Fatalf
(
"%v"
,
err
)
utils
.
Fatalf
(
"%v"
,
err
)
...
@@ -290,7 +301,7 @@ func run(ctx *cli.Context) {
...
@@ -290,7 +301,7 @@ func run(ctx *cli.Context) {
}
}
func
console
(
ctx
*
cli
.
Context
)
{
func
console
(
ctx
*
cli
.
Context
)
{
cfg
:=
utils
.
MakeEthConfig
(
ClientIdentifier
,
Version
,
ctx
)
cfg
:=
utils
.
MakeEthConfig
(
ClientIdentifier
,
nodeName
Version
,
ctx
)
ethereum
,
err
:=
eth
.
New
(
cfg
)
ethereum
,
err
:=
eth
.
New
(
cfg
)
if
err
!=
nil
{
if
err
!=
nil
{
utils
.
Fatalf
(
"%v"
,
err
)
utils
.
Fatalf
(
"%v"
,
err
)
...
@@ -305,7 +316,7 @@ func console(ctx *cli.Context) {
...
@@ -305,7 +316,7 @@ func console(ctx *cli.Context) {
}
}
func
execJSFiles
(
ctx
*
cli
.
Context
)
{
func
execJSFiles
(
ctx
*
cli
.
Context
)
{
cfg
:=
utils
.
MakeEthConfig
(
ClientIdentifier
,
Version
,
ctx
)
cfg
:=
utils
.
MakeEthConfig
(
ClientIdentifier
,
nodeName
Version
,
ctx
)
ethereum
,
err
:=
eth
.
New
(
cfg
)
ethereum
,
err
:=
eth
.
New
(
cfg
)
if
err
!=
nil
{
if
err
!=
nil
{
utils
.
Fatalf
(
"%v"
,
err
)
utils
.
Fatalf
(
"%v"
,
err
)
...
@@ -487,7 +498,7 @@ func exportchain(ctx *cli.Context) {
...
@@ -487,7 +498,7 @@ func exportchain(ctx *cli.Context) {
utils
.
Fatalf
(
"This command requires an argument."
)
utils
.
Fatalf
(
"This command requires an argument."
)
}
}
cfg
:=
utils
.
MakeEthConfig
(
ClientIdentifier
,
Version
,
ctx
)
cfg
:=
utils
.
MakeEthConfig
(
ClientIdentifier
,
nodeName
Version
,
ctx
)
cfg
.
SkipBcVersionCheck
=
true
cfg
.
SkipBcVersionCheck
=
true
ethereum
,
err
:=
eth
.
New
(
cfg
)
ethereum
,
err
:=
eth
.
New
(
cfg
)
...
@@ -589,15 +600,17 @@ func makedag(ctx *cli.Context) {
...
@@ -589,15 +600,17 @@ func makedag(ctx *cli.Context) {
}
}
func
version
(
c
*
cli
.
Context
)
{
func
version
(
c
*
cli
.
Context
)
{
fmt
.
Printf
(
`%v
fmt
.
Println
(
ClientIdentifier
)
Version: %v
fmt
.
Println
(
"Version:"
,
Version
)
Protocol Version: %d
if
gitCommit
!=
""
{
Network Id: %d
fmt
.
Println
(
"Git Commit:"
,
gitCommit
)
GO: %s
}
OS: %s
fmt
.
Println
(
"Protocol Version:"
,
c
.
GlobalInt
(
utils
.
ProtocolVersionFlag
.
Name
))
GOPATH=%s
fmt
.
Println
(
"Network Id:"
,
c
.
GlobalInt
(
utils
.
NetworkIdFlag
.
Name
))
GOROOT=%s
fmt
.
Println
(
"Go Version:"
,
runtime
.
Version
())
`
,
ClientIdentifier
,
Version
,
c
.
GlobalInt
(
utils
.
ProtocolVersionFlag
.
Name
),
c
.
GlobalInt
(
utils
.
NetworkIdFlag
.
Name
),
runtime
.
Version
(),
runtime
.
GOOS
,
os
.
Getenv
(
"GOPATH"
),
runtime
.
GOROOT
())
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.
// hashish returns true for strings that look like hashes.
...
...
cmd/mist/main.go
View file @
eb5e4302
...
@@ -41,6 +41,9 @@ const (
...
@@ -41,6 +41,9 @@ const (
)
)
var
(
var
(
gitCommit
string
// set via linker flag
nodeNameVersion
string
app
=
utils
.
NewApp
(
Version
,
"the ether browser"
)
app
=
utils
.
NewApp
(
Version
,
"the ether browser"
)
assetPathFlag
=
cli
.
StringFlag
{
assetPathFlag
=
cli
.
StringFlag
{
Name
:
"asset_path"
,
Name
:
"asset_path"
,
...
@@ -55,6 +58,11 @@ func init() {
...
@@ -55,6 +58,11 @@ func init() {
if
len
(
rpcCorsFlag
.
Value
)
==
0
{
if
len
(
rpcCorsFlag
.
Value
)
==
0
{
rpcCorsFlag
.
Value
=
"http://localhost"
rpcCorsFlag
.
Value
=
"http://localhost"
}
}
if
gitCommit
==
""
{
nodeNameVersion
=
Version
}
else
{
nodeNameVersion
=
Version
+
"-"
+
gitCommit
[
:
8
]
}
app
.
Action
=
run
app
.
Action
=
run
app
.
Flags
=
[]
cli
.
Flag
{
app
.
Flags
=
[]
cli
.
Flag
{
...
@@ -107,7 +115,7 @@ func run(ctx *cli.Context) {
...
@@ -107,7 +115,7 @@ func run(ctx *cli.Context) {
tstart
:=
time
.
Now
()
tstart
:=
time
.
Now
()
// TODO: show qml popup instead of exiting if initialization fails.
// TODO: show qml popup instead of exiting if initialization fails.
cfg
:=
utils
.
MakeEthConfig
(
ClientIdentifier
,
Version
,
ctx
)
cfg
:=
utils
.
MakeEthConfig
(
ClientIdentifier
,
nodeName
Version
,
ctx
)
ethereum
,
err
:=
eth
.
New
(
cfg
)
ethereum
,
err
:=
eth
.
New
(
cfg
)
if
err
!=
nil
{
if
err
!=
nil
{
utils
.
Fatalf
(
"%v"
,
err
)
utils
.
Fatalf
(
"%v"
,
err
)
...
...
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