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
8b9dcdcd
Commit
8b9dcdcd
authored
Jan 27, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debugging handles
parent
c6062a0f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
dev_console.go
dev_console.go
+11
-1
ethereum.go
ethereum.go
+4
-3
No files found.
dev_console.go
View file @
8b9dcdcd
...
...
@@ -9,7 +9,7 @@ import (
"github.com/ethereum/ethchain-go"
"github.com/ethereum/ethdb-go"
"github.com/ethereum/ethutil-go"
_
"github.com/ethereum/ethwire-go"
"github.com/ethereum/ethwire-go"
_
"math/big"
"os"
"strings"
...
...
@@ -60,6 +60,12 @@ func (i *Console) ValidateInput(action string, argumentLength int) error {
case
action
==
"contract"
&&
argumentLength
!=
1
:
err
=
true
expArgCount
=
1
case
action
==
"say"
&&
argumentLength
!=
1
:
err
=
true
expArgCount
=
1
case
action
==
"addp"
&&
argumentLength
!=
1
:
err
=
true
expArgCount
=
1
}
if
err
{
...
...
@@ -129,6 +135,10 @@ func (i *Console) ParseInput(input string) bool {
}
else
{
fmt
.
Println
(
"getaddr: address unknown"
)
}
case
"say"
:
i
.
ethereum
.
Broadcast
(
ethwire
.
MsgTalkTy
,
tokens
[
1
])
case
"addp"
:
i
.
ethereum
.
ConnectToPeer
(
tokens
[
1
])
case
"encode"
:
fmt
.
Printf
(
"%q
\n
"
,
ethutil
.
Encode
(
tokens
[
1
]))
/*
...
...
ethereum.go
View file @
8b9dcdcd
...
...
@@ -50,6 +50,8 @@ func main() {
ethchain
.
InitFees
()
ethutil
.
ReadConfig
()
log
.
Printf
(
"Starting Ethereum v%s
\n
"
,
ethutil
.
Config
.
Ver
)
// Instantiated a eth stack
ethereum
,
err
:=
eth
.
New
()
if
err
!=
nil
{
...
...
@@ -77,8 +79,6 @@ func main() {
go
console
.
Start
()
}
log
.
Println
(
"Starting Ethereum"
)
RegisterInterupts
(
ethereum
)
ethereum
.
Start
()
...
...
@@ -90,10 +90,11 @@ func main() {
// Fake block mining. It broadcasts a new block every 5 seconds
go
func
()
{
for
{
txs
:=
ethereum
.
TxPool
.
Flush
()
time
.
Sleep
(
blockTime
*
time
.
Second
)
txs
:=
ethereum
.
TxPool
.
Flush
()
block
:=
ethchain
.
CreateBlock
(
ethereum
.
BlockManager
.
CurrentBlock
.
State
()
.
Root
,
ethereum
.
BlockManager
.
LastBlockHash
,
...
...
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