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
0bb7377e
Commit
0bb7377e
authored
Mar 10, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/ethereum: show more helpful message if no accounts exist
parent
9d4e1e8f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
9 deletions
+23
-9
main.go
cmd/ethereum/main.go
+17
-2
main.go
cmd/mist/main.go
+4
-1
flags.go
cmd/utils/flags.go
+2
-6
No files found.
cmd/ethereum/main.go
View file @
0bb7377e
...
@@ -29,6 +29,7 @@ import (
...
@@ -29,6 +29,7 @@ import (
"time"
"time"
"github.com/codegangsta/cli"
"github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/eth"
...
@@ -148,14 +149,28 @@ func main() {
...
@@ -148,14 +149,28 @@ func main() {
func
run
(
ctx
*
cli
.
Context
)
{
func
run
(
ctx
*
cli
.
Context
)
{
fmt
.
Printf
(
"Welcome to the FRONTIER
\n
"
)
fmt
.
Printf
(
"Welcome to the FRONTIER
\n
"
)
utils
.
HandleInterrupt
()
utils
.
HandleInterrupt
()
eth
:=
utils
.
GetEthereum
(
ClientIdentifier
,
Version
,
ctx
)
eth
,
err
:=
utils
.
GetEthereum
(
ClientIdentifier
,
Version
,
ctx
)
if
err
==
accounts
.
ErrNoKeys
{
utils
.
Fatalf
(
`No accounts configured.
Please run 'ethereum account new' to create a new account.`
)
}
else
if
err
!=
nil
{
utils
.
Fatalf
(
"%v"
,
err
)
}
startEth
(
ctx
,
eth
)
startEth
(
ctx
,
eth
)
// this blocks the thread
// this blocks the thread
eth
.
WaitForShutdown
()
eth
.
WaitForShutdown
()
}
}
func
runjs
(
ctx
*
cli
.
Context
)
{
func
runjs
(
ctx
*
cli
.
Context
)
{
eth
:=
utils
.
GetEthereum
(
ClientIdentifier
,
Version
,
ctx
)
eth
,
err
:=
utils
.
GetEthereum
(
ClientIdentifier
,
Version
,
ctx
)
if
err
==
accounts
.
ErrNoKeys
{
utils
.
Fatalf
(
`No accounts configured.
Please run 'ethereum account new' to create a new account.`
)
}
else
if
err
!=
nil
{
utils
.
Fatalf
(
"%v"
,
err
)
}
startEth
(
ctx
,
eth
)
startEth
(
ctx
,
eth
)
repl
:=
newJSRE
(
eth
)
repl
:=
newJSRE
(
eth
)
if
len
(
ctx
.
Args
())
==
0
{
if
len
(
ctx
.
Args
())
==
0
{
...
...
cmd/mist/main.go
View file @
0bb7377e
...
@@ -95,7 +95,10 @@ func run(ctx *cli.Context) {
...
@@ -95,7 +95,10 @@ 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.
ethereum
:=
utils
.
GetEthereum
(
ClientIdentifier
,
Version
,
ctx
)
ethereum
,
err
:=
utils
.
GetEthereum
(
ClientIdentifier
,
Version
,
ctx
)
if
err
!=
nil
{
utils
.
Fatalf
(
"%v"
,
err
)
}
utils
.
StartRPC
(
ethereum
,
ctx
)
utils
.
StartRPC
(
ethereum
,
ctx
)
go
utils
.
StartEthereum
(
ethereum
)
go
utils
.
StartEthereum
(
ethereum
)
fmt
.
Println
(
"initializing eth stack took"
,
time
.
Since
(
tstart
))
fmt
.
Println
(
"initializing eth stack took"
,
time
.
Since
(
tstart
))
...
...
cmd/utils/flags.go
View file @
0bb7377e
...
@@ -157,8 +157,8 @@ func GetNodeKey(ctx *cli.Context) (key *ecdsa.PrivateKey) {
...
@@ -157,8 +157,8 @@ func GetNodeKey(ctx *cli.Context) (key *ecdsa.PrivateKey) {
return
key
return
key
}
}
func
GetEthereum
(
clientID
,
version
string
,
ctx
*
cli
.
Context
)
*
eth
.
Ethereum
{
func
GetEthereum
(
clientID
,
version
string
,
ctx
*
cli
.
Context
)
(
*
eth
.
Ethereum
,
error
)
{
ethereum
,
err
:=
eth
.
New
(
&
eth
.
Config
{
return
eth
.
New
(
&
eth
.
Config
{
Name
:
p2p
.
MakeName
(
clientID
,
version
),
Name
:
p2p
.
MakeName
(
clientID
,
version
),
DataDir
:
ctx
.
GlobalString
(
DataDirFlag
.
Name
),
DataDir
:
ctx
.
GlobalString
(
DataDirFlag
.
Name
),
LogFile
:
ctx
.
GlobalString
(
LogFileFlag
.
Name
),
LogFile
:
ctx
.
GlobalString
(
LogFileFlag
.
Name
),
...
@@ -175,10 +175,6 @@ func GetEthereum(clientID, version string, ctx *cli.Context) *eth.Ethereum {
...
@@ -175,10 +175,6 @@ func GetEthereum(clientID, version string, ctx *cli.Context) *eth.Ethereum {
Dial
:
true
,
Dial
:
true
,
BootNodes
:
ctx
.
GlobalString
(
BootnodesFlag
.
Name
),
BootNodes
:
ctx
.
GlobalString
(
BootnodesFlag
.
Name
),
})
})
if
err
!=
nil
{
exit
(
err
)
}
return
ethereum
}
}
func
GetChain
(
ctx
*
cli
.
Context
)
(
*
core
.
ChainManager
,
ethutil
.
Database
,
ethutil
.
Database
)
{
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