good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
0bb7377e
Commit
0bb7377e
authored
10 years ago
by
Felix Lange
Browse files
Options
Downloads
Patches
Plain Diff
cmd/ethereum: show more helpful message if no accounts exist
parent
9d4e1e8f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cmd/ethereum/main.go
+17
-2
17 additions, 2 deletions
cmd/ethereum/main.go
cmd/mist/main.go
+4
-1
4 additions, 1 deletion
cmd/mist/main.go
cmd/utils/flags.go
+2
-6
2 additions, 6 deletions
cmd/utils/flags.go
with
23 additions
and
9 deletions
cmd/ethereum/main.go
+
17
−
2
View file @
0bb7377e
...
...
@@ -29,6 +29,7 @@ import (
"time"
"github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/eth"
...
...
@@ -148,14 +149,28 @@ func main() {
func
run
(
ctx
*
cli
.
Context
)
{
fmt
.
Printf
(
"Welcome to the FRONTIER
\n
"
)
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
)
// this blocks the thread
eth
.
WaitForShutdown
()
}
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
)
repl
:=
newJSRE
(
eth
)
if
len
(
ctx
.
Args
())
==
0
{
...
...
This diff is collapsed.
Click to expand it.
cmd/mist/main.go
+
4
−
1
View file @
0bb7377e
...
...
@@ -95,7 +95,10 @@ func run(ctx *cli.Context) {
tstart
:=
time
.
Now
()
// 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
)
go
utils
.
StartEthereum
(
ethereum
)
fmt
.
Println
(
"initializing eth stack took"
,
time
.
Since
(
tstart
))
...
...
This diff is collapsed.
Click to expand it.
cmd/utils/flags.go
+
2
−
6
View file @
0bb7377e
...
...
@@ -157,8 +157,8 @@ func GetNodeKey(ctx *cli.Context) (key *ecdsa.PrivateKey) {
return
key
}
func
GetEthereum
(
clientID
,
version
string
,
ctx
*
cli
.
Context
)
*
eth
.
Ethereum
{
et
hereum
,
err
:=
eth
.
New
(
&
eth
.
Config
{
func
GetEthereum
(
clientID
,
version
string
,
ctx
*
cli
.
Context
)
(
*
eth
.
Ethereum
,
error
)
{
r
et
urn
eth
.
New
(
&
eth
.
Config
{
Name
:
p2p
.
MakeName
(
clientID
,
version
),
DataDir
:
ctx
.
GlobalString
(
DataDirFlag
.
Name
),
LogFile
:
ctx
.
GlobalString
(
LogFileFlag
.
Name
),
...
...
@@ -175,10 +175,6 @@ func GetEthereum(clientID, version string, ctx *cli.Context) *eth.Ethereum {
Dial
:
true
,
BootNodes
:
ctx
.
GlobalString
(
BootnodesFlag
.
Name
),
})
if
err
!=
nil
{
exit
(
err
)
}
return
ethereum
}
func
GetChain
(
ctx
*
cli
.
Context
)
(
*
core
.
ChainManager
,
ethutil
.
Database
,
ethutil
.
Database
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment