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
c92e48ce
Commit
c92e48ce
authored
Mar 04, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add client_version RPC message
parent
e7b33e9a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
backend.go
eth/backend.go
+4
-1
api.go
rpc/api.go
+2
-0
xeth.go
xeth/xeth.go
+5
-0
No files found.
eth/backend.go
View file @
c92e48ce
...
...
@@ -133,6 +133,7 @@ type Ethereum struct {
logger
ethlogger
.
LogSystem
Mining
bool
version
string
}
func
New
(
config
*
Config
)
(
*
Ethereum
,
error
)
{
...
...
@@ -175,6 +176,7 @@ func New(config *Config) (*Ethereum, error) {
blacklist
:
p2p
.
NewBlacklist
(),
eventMux
:
&
event
.
TypeMux
{},
logger
:
logger
,
version
:
config
.
Name
,
}
eth
.
chainManager
=
core
.
NewChainManager
(
db
,
eth
.
EventMux
())
...
...
@@ -231,6 +233,7 @@ func (s *Ethereum) PeerCount() int { return s.net.PeerCoun
func
(
s
*
Ethereum
)
Peers
()
[]
*
p2p
.
Peer
{
return
s
.
net
.
Peers
()
}
func
(
s
*
Ethereum
)
MaxPeers
()
int
{
return
s
.
net
.
MaxPeers
}
func
(
s
*
Ethereum
)
Coinbase
()
[]
byte
{
return
nil
}
// TODO
func
(
s
*
Ethereum
)
ClientVersion
()
string
{
return
s
.
version
}
// Start the ethereum
func
(
s
*
Ethereum
)
Start
()
error
{
...
...
rpc/api.go
View file @
c92e48ce
...
...
@@ -668,6 +668,8 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
return
err
}
return
p
.
WhisperMessages
(
args
,
reply
)
case
"client_version"
:
*
reply
=
p
.
eth
.
GetClientVersion
()
default
:
return
NewErrorWithMessage
(
errNotImplemented
,
req
.
Method
)
}
...
...
xeth/xeth.go
View file @
c92e48ce
...
...
@@ -36,6 +36,7 @@ type Backend interface {
EventMux
()
*
event
.
TypeMux
Whisper
()
*
whisper
.
Whisper
Miner
()
*
miner
.
Miner
ClientVersion
()
string
}
type
XEth
struct
{
...
...
@@ -164,6 +165,10 @@ func (self *XEth) IsContract(address string) bool {
return
len
(
self
.
State
()
.
SafeGet
(
address
)
.
Code
())
>
0
}
func
(
self
*
XEth
)
GetClientVersion
()
string
{
return
self
.
eth
.
ClientVersion
()
}
func
(
self
*
XEth
)
SecretToAddress
(
key
string
)
string
{
pair
,
err
:=
crypto
.
NewKeyPairFromSec
(
fromHex
(
key
))
if
err
!=
nil
{
...
...
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