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
bcd8aeef
Commit
bcd8aeef
authored
Feb 20, 2016
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth: add chaindbProperty to debug API
parent
05e257c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
api.go
eth/api.go
+18
-0
javascript.go
rpc/javascript.go
+6
-0
No files found.
eth/api.go
View file @
bcd8aeef
...
...
@@ -26,6 +26,7 @@ import (
"math/big"
"os"
"runtime"
"strings"
"sync"
"time"
...
...
@@ -46,6 +47,7 @@ import (
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rpc"
"github.com/syndtr/goleveldb/leveldb"
"golang.org/x/net/context"
)
...
...
@@ -1566,6 +1568,22 @@ func NewPrivateDebugAPI(config *core.ChainConfig, eth *Ethereum) *PrivateDebugAP
return
&
PrivateDebugAPI
{
config
:
config
,
eth
:
eth
}
}
// ChaindbProperty returns leveldb properties of the chain database.
func
(
api
*
PrivateDebugAPI
)
ChaindbProperty
(
property
string
)
(
string
,
error
)
{
ldb
,
ok
:=
api
.
eth
.
chainDb
.
(
interface
{
LDB
()
*
leveldb
.
DB
})
if
!
ok
{
return
""
,
fmt
.
Errorf
(
"chaindbProperty does not work for memory databases"
)
}
if
property
==
""
{
property
=
"leveldb.stats"
}
else
if
!
strings
.
HasPrefix
(
property
,
"leveldb."
)
{
property
=
"leveldb."
+
property
}
return
ldb
.
LDB
()
.
GetProperty
(
property
)
}
// BlockTraceResults is the returned value when replaying a block to check for
// consensus results and full VM trace logs for all included transactions.
type
BlockTraceResult
struct
{
...
...
rpc/javascript.go
View file @
bcd8aeef
...
...
@@ -295,6 +295,12 @@ web3._extend({
call: 'debug_dumpBlock',
params: 1
}),
new web3._extend.Method({
name: 'chaindbProperty',
call: 'debug_chaindbProperty',
params: 1,
outputFormatter: console.log
}),
new web3._extend.Method({
name: 'metrics',
call: 'debug_metrics',
...
...
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