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
58d9d98d
Commit
58d9d98d
authored
Mar 13, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/utils: GetEthereum -> MakeEthConfig
This allows changing the config before starting Ethereum with it.
parent
a80be98f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
12 deletions
+16
-12
main.go
cmd/ethereum/main.go
+10
-8
main.go
cmd/mist/main.go
+3
-1
flags.go
cmd/utils/flags.go
+3
-3
No files found.
cmd/ethereum/main.go
View file @
58d9d98d
...
...
@@ -156,24 +156,26 @@ func main() {
func
run
(
ctx
*
cli
.
Context
)
{
fmt
.
Printf
(
"Welcome to the FRONTIER
\n
"
)
utils
.
HandleInterrupt
()
eth
,
err
:=
utils
.
GetEthereum
(
ClientIdentifier
,
Version
,
ctx
)
cfg
:=
utils
.
MakeEthConfig
(
ClientIdentifier
,
Version
,
ctx
)
ethereum
,
err
:=
eth
.
New
(
cfg
)
if
err
!=
nil
{
utils
.
Fatalf
(
"%v"
,
err
)
}
startEth
(
ctx
,
eth
)
startEth
(
ctx
,
eth
ereum
)
// this blocks the thread
eth
.
WaitForShutdown
()
eth
ereum
.
WaitForShutdown
()
}
func
runjs
(
ctx
*
cli
.
Context
)
{
eth
,
err
:=
utils
.
GetEthereum
(
ClientIdentifier
,
Version
,
ctx
)
cfg
:=
utils
.
MakeEthConfig
(
ClientIdentifier
,
Version
,
ctx
)
ethereum
,
err
:=
eth
.
New
(
cfg
)
if
err
!=
nil
{
utils
.
Fatalf
(
"%v"
,
err
)
}
startEth
(
ctx
,
eth
)
repl
:=
newJSRE
(
eth
)
startEth
(
ctx
,
eth
ereum
)
repl
:=
newJSRE
(
eth
ereum
)
if
len
(
ctx
.
Args
())
==
0
{
repl
.
interactive
()
}
else
{
...
...
@@ -181,8 +183,8 @@ func runjs(ctx *cli.Context) {
repl
.
exec
(
file
)
}
}
eth
.
Stop
()
eth
.
WaitForShutdown
()
eth
ereum
.
Stop
()
eth
ereum
.
WaitForShutdown
()
}
func
startEth
(
ctx
*
cli
.
Context
,
eth
*
eth
.
Ethereum
)
{
...
...
cmd/mist/main.go
View file @
58d9d98d
...
...
@@ -28,6 +28,7 @@ import (
"github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/ui/qt/webengine"
...
...
@@ -95,7 +96,8 @@ func run(ctx *cli.Context) {
tstart
:=
time
.
Now
()
// TODO: show qml popup instead of exiting if initialization fails.
ethereum
,
err
:=
utils
.
GetEthereum
(
ClientIdentifier
,
Version
,
ctx
)
cfg
:=
utils
.
MakeEthConfig
(
ClientIdentifier
,
Version
,
ctx
)
ethereum
,
err
:=
eth
.
New
(
cfg
)
if
err
!=
nil
{
utils
.
Fatalf
(
"%v"
,
err
)
}
...
...
cmd/utils/flags.go
View file @
58d9d98d
...
...
@@ -192,8 +192,8 @@ func GetNodeKey(ctx *cli.Context) (key *ecdsa.PrivateKey) {
return
key
}
func
GetEthereum
(
clientID
,
version
string
,
ctx
*
cli
.
Context
)
(
*
eth
.
Ethereum
,
error
)
{
return
eth
.
New
(
&
eth
.
Config
{
func
MakeEthConfig
(
clientID
,
version
string
,
ctx
*
cli
.
Context
)
*
eth
.
Config
{
return
&
eth
.
Config
{
Name
:
p2p
.
MakeName
(
clientID
,
version
),
DataDir
:
ctx
.
GlobalString
(
DataDirFlag
.
Name
),
LogFile
:
ctx
.
GlobalString
(
LogFileFlag
.
Name
),
...
...
@@ -209,7 +209,7 @@ func GetEthereum(clientID, version string, ctx *cli.Context) (*eth.Ethereum, err
Shh
:
true
,
Dial
:
true
,
BootNodes
:
ctx
.
GlobalString
(
BootnodesFlag
.
Name
),
}
)
}
}
func
GetChain
(
ctx
*
cli
.
Context
)
(
*
core
.
ChainManager
,
ethutil
.
Database
,
ethutil
.
Database
)
{
...
...
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