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
980987ae
Commit
980987ae
authored
Feb 10, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added block retrieval
parent
d831064f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
dev_console.go
dev_console.go
+11
-7
No files found.
dev_console.go
View file @
980987ae
...
@@ -66,6 +66,9 @@ func (i *Console) ValidateInput(action string, argumentLength int) error {
...
@@ -66,6 +66,9 @@ func (i *Console) ValidateInput(action string, argumentLength int) error {
case
action
==
"addp"
&&
argumentLength
!=
1
:
case
action
==
"addp"
&&
argumentLength
!=
1
:
err
=
true
err
=
true
expArgCount
=
1
expArgCount
=
1
case
action
==
"block"
&&
argumentLength
!=
1
:
err
=
true
expArgCount
=
1
}
}
if
err
{
if
err
{
...
@@ -128,13 +131,12 @@ func (i *Console) ParseInput(input string) bool {
...
@@ -128,13 +131,12 @@ func (i *Console) ParseInput(input string) bool {
fmt
.
Println
(
value
)
fmt
.
Println
(
value
)
case
"getaddr"
:
case
"getaddr"
:
encoded
,
_
:=
hex
.
DecodeString
(
tokens
[
1
])
encoded
,
_
:=
hex
.
DecodeString
(
tokens
[
1
])
d
:=
i
.
ethereum
.
BlockManager
.
BlockChain
()
.
CurrentBlock
.
State
()
.
Get
(
string
(
encoded
))
addr
:=
i
.
ethereum
.
BlockManager
.
BlockChain
()
.
CurrentBlock
.
GetAddr
(
encoded
)
if
d
!=
""
{
fmt
.
Println
(
"addr:"
,
addr
)
decoder
:=
ethutil
.
NewRlpValueFromBytes
([]
byte
(
d
))
case
"block"
:
fmt
.
Println
(
decoder
)
encoded
,
_
:=
hex
.
DecodeString
(
tokens
[
1
])
}
else
{
block
:=
i
.
ethereum
.
BlockManager
.
BlockChain
()
.
GetBlock
(
encoded
)
fmt
.
Println
(
"getaddr: address unknown"
)
fmt
.
Println
(
block
)
}
case
"say"
:
case
"say"
:
i
.
ethereum
.
Broadcast
(
ethwire
.
MsgTalkTy
,
[]
interface
{}{
tokens
[
1
]})
i
.
ethereum
.
Broadcast
(
ethwire
.
MsgTalkTy
,
[]
interface
{}{
tokens
[
1
]})
case
"addp"
:
case
"addp"
:
...
@@ -179,6 +181,8 @@ func (i *Console) ParseInput(input string) bool {
...
@@ -179,6 +181,8 @@ func (i *Console) ParseInput(input string) bool {
"get KEY - Retrieves the given key
\n
"
+
"get KEY - Retrieves the given key
\n
"
+
"root - Prints the hex encoded merkle root
\n
"
+
"root - Prints the hex encoded merkle root
\n
"
+
"rawroot - Prints the raw merkle root
\n
"
+
"rawroot - Prints the raw merkle root
\n
"
+
"block HASH - Prints the block
\n
"
+
"getaddr ADDR - Prints the account associated with the address
\n
"
+
"
\0
33[1m= Dagger =
\0
33[0m
\n
"
+
"
\0
33[1m= Dagger =
\0
33[0m
\n
"
+
"dag HASH NONCE - Verifies a nonce with the given hash with dagger
\n
"
+
"dag HASH NONCE - Verifies a nonce with the given hash with dagger
\n
"
+
"
\0
33[1m= Encoding =
\0
33[0m
\n
"
+
"
\0
33[1m= Encoding =
\0
33[0m
\n
"
+
...
...
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