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
278ee3f1
Commit
278ee3f1
authored
May 14, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop
parents
9a057021
a1dcc5cd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
22 deletions
+28
-22
ethereum.go
ethereal/ethereum.go
+1
-8
ethereum.go
ethereum/ethereum.go
+1
-8
cmd.go
utils/cmd.go
+26
-6
No files found.
ethereal/ethereum.go
View file @
278ee3f1
...
...
@@ -4,8 +4,6 @@ import (
"fmt"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethrpc"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/go-ethereum/ethereal/ui"
"github.com/ethereum/go-ethereum/utils"
...
...
@@ -115,12 +113,7 @@ save these words so you can restore your account later: %s
}
if
StartRpc
{
ethereum
.
RpcServer
,
err
=
ethrpc
.
NewJsonRpcServer
(
ethpub
.
NewPEthereum
(
ethereum
),
RpcPort
)
if
err
!=
nil
{
log
.
Println
(
"Could not start RPC interface:"
,
err
)
}
else
{
go
ethereum
.
RpcServer
.
Start
()
}
utils
.
DoRpc
(
ethereum
,
RpcPort
)
}
log
.
Printf
(
"Starting Ethereum GUI v%s
\n
"
,
ethutil
.
Config
.
Ver
)
...
...
ethereum/ethereum.go
View file @
278ee3f1
...
...
@@ -4,8 +4,6 @@ import (
"fmt"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethrpc"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/go-ethereum/utils"
"log"
...
...
@@ -149,12 +147,7 @@ save these words so you can restore your account later: %s
go
console
.
Start
()
}
if
StartRpc
{
ethereum
.
RpcServer
,
err
=
ethrpc
.
NewJsonRpcServer
(
ethpub
.
NewPEthereum
(
ethereum
),
RpcPort
)
if
err
!=
nil
{
logger
.
Infoln
(
"Could not start RPC interface:"
,
err
)
}
else
{
go
ethereum
.
RpcServer
.
Start
()
}
utils
.
DoRpc
(
ethereum
,
RpcPort
)
}
RegisterInterrupts
(
ethereum
)
...
...
utils/cmd.go
View file @
278ee3f1
...
...
@@ -3,24 +3,44 @@ package utils
import
(
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethminer"
_
"github.com/ethereum/eth-go/ethrpc"
"github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethrpc"
"github.com/ethereum/eth-go/ethutil"
"log"
"time"
)
func
DoRpc
(
ethereum
*
eth
.
Ethereum
,
RpcPort
int
)
{
var
err
error
ethereum
.
RpcServer
,
err
=
ethrpc
.
NewJsonRpcServer
(
ethpub
.
NewPEthereum
(
ethereum
),
RpcPort
)
if
err
!=
nil
{
log
.
Println
(
"Could not start RPC interface:"
,
err
)
}
else
{
go
ethereum
.
RpcServer
.
Start
()
}
}
func
DoMining
(
ethereum
*
eth
.
Ethereum
)
{
// Set Mining status
ethereum
.
Mining
=
true
log
.
Println
(
"Miner started"
)
// Fake block mining. It broadcasts a new block every 5 seconds
go
func
()
{
if
ethutil
.
GetKeyRing
()
.
Len
()
==
0
{
log
.
Println
(
"No address found, can't start mining"
)
return
}
keyPair
:=
ethutil
.
GetKeyRing
()
.
Get
(
0
)
addr
:=
keyPair
.
Address
()
go
func
()
{
// Give it some time to connect with peers
time
.
Sleep
(
3
*
time
.
Second
)
for
ethereum
.
IsUpToDate
()
==
false
{
time
.
Sleep
(
5
*
time
.
Second
)
}
log
.
Println
(
"Miner started"
)
miner
:=
ethminer
.
NewDefaultMiner
(
addr
,
ethereum
)
miner
.
Start
()
}()
}
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