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
d4ed66c8
Commit
d4ed66c8
authored
10 years ago
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add web3_clientVersion
parent
094f921e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
backend.go
eth/backend.go
+3
-0
api.go
rpc/api.go
+7
-7
xeth.go
xeth/xeth.go
+1
-0
No files found.
eth/backend.go
View file @
d4ed66c8
...
...
@@ -131,6 +131,7 @@ type Ethereum struct {
Mining
bool
DataDir
string
version
string
}
func
New
(
config
*
Config
)
(
*
Ethereum
,
error
)
{
...
...
@@ -165,6 +166,7 @@ func New(config *Config) (*Ethereum, error) {
logger
:
servlogger
,
accountManager
:
config
.
AccountManager
,
DataDir
:
config
.
DataDir
,
version
:
config
.
Name
,
// TODO should separate from Name
}
eth
.
chainManager
=
core
.
NewChainManager
(
blockDb
,
stateDb
,
eth
.
EventMux
())
...
...
@@ -236,6 +238,7 @@ func (s *Ethereum) IsListening() bool { return true } // Alwa
func
(
s
*
Ethereum
)
PeerCount
()
int
{
return
s
.
net
.
PeerCount
()
}
func
(
s
*
Ethereum
)
Peers
()
[]
*
p2p
.
Peer
{
return
s
.
net
.
Peers
()
}
func
(
s
*
Ethereum
)
MaxPeers
()
int
{
return
s
.
net
.
MaxPeers
}
func
(
s
*
Ethereum
)
Version
()
string
{
return
s
.
version
}
// Start the ethereum
func
(
s
*
Ethereum
)
Start
()
error
{
...
...
This diff is collapsed.
Click to expand it.
rpc/api.go
View file @
d4ed66c8
...
...
@@ -477,6 +477,10 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
return
err
}
*
reply
=
toHex
(
crypto
.
Sha3
(
fromHex
(
args
.
Data
)))
case
"web3_clientVersion"
:
*
reply
=
p
.
xeth
()
.
Backend
()
.
Version
()
case
"net_version"
:
return
NewNotImplementedError
(
req
.
Method
)
case
"net_listening"
:
*
reply
=
p
.
xeth
()
.
IsListening
()
case
"net_peerCount"
:
...
...
@@ -675,9 +679,7 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
*
reply
=
uncle
case
"eth_getCompilers"
:
return
p
.
GetCompilers
(
reply
)
case
"eth_compileSolidity"
:
case
"eth_compileLLL"
:
case
"eth_compileSerpent"
:
case
"eth_compileSolidity"
,
"eth_compileLLL"
,
"eth_compileSerpent"
:
return
NewNotImplementedError
(
req
.
Method
)
case
"eth_newFilter"
:
args
:=
new
(
FilterOptions
)
...
...
@@ -715,8 +717,7 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
return
err
}
return
p
.
AllLogs
(
args
,
reply
)
case
"eth_getWork"
:
case
"eth_submitWork"
:
case
"eth_getWork"
,
"eth_submitWork"
:
return
NewNotImplementedError
(
req
.
Method
)
case
"db_put"
:
args
:=
new
(
DbArgs
)
...
...
@@ -744,8 +745,7 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
return
err
}
return
p
.
HasWhisperIdentity
(
args
.
Identity
,
reply
)
case
"shh_newGroup"
:
case
"shh_addToGroup"
:
case
"shh_newGroup"
,
"shh_addToGroup"
:
return
NewNotImplementedError
(
req
.
Method
)
case
"shh_newFilter"
:
args
:=
new
(
WhisperFilterArgs
)
...
...
This diff is collapsed.
Click to expand it.
xeth/xeth.go
View file @
d4ed66c8
...
...
@@ -39,6 +39,7 @@ type Backend interface {
IsMining
()
bool
StartMining
()
error
StopMining
()
Version
()
string
}
// Frontend should be implemented by users of XEth. Its methods are
...
...
This diff is collapsed.
Click to expand it.
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