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
b06f44ec
Commit
b06f44ec
authored
Apr 21, 2016
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: add a `--fakepow` flag to help benchmarking database changes
parent
18580e15
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
main.go
cmd/geth/main.go
+1
-0
usage.go
cmd/geth/usage.go
+5
-2
flags.go
cmd/utils/flags.go
+10
-3
No files found.
cmd/geth/main.go
View file @
b06f44ec
...
...
@@ -205,6 +205,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils
.
NetworkIdFlag
,
utils
.
RPCCORSDomainFlag
,
utils
.
MetricsEnabledFlag
,
utils
.
FakePoWFlag
,
utils
.
SolcPathFlag
,
utils
.
GpoMinGasPriceFlag
,
utils
.
GpoMaxGasPriceFlag
,
...
...
cmd/geth/usage.go
View file @
b06f44ec
...
...
@@ -150,8 +150,11 @@ var AppHelpFlagGroups = []flagGroup{
},
},
{
Name
:
"LOGGING AND DEBUGGING"
,
Flags
:
append
([]
cli
.
Flag
{
utils
.
MetricsEnabledFlag
},
debug
.
Flags
...
),
Name
:
"LOGGING AND DEBUGGING"
,
Flags
:
append
([]
cli
.
Flag
{
utils
.
MetricsEnabledFlag
,
utils
.
FakePoWFlag
,
},
debug
.
Flags
...
),
},
{
Name
:
"EXPERIMENTAL"
,
...
...
cmd/utils/flags.go
View file @
b06f44ec
...
...
@@ -47,6 +47,7 @@ import (
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/nat"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/pow"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/whisper"
)
...
...
@@ -228,6 +229,10 @@ var (
Name
:
metrics
.
MetricsEnabledFlag
,
Usage
:
"Enable metrics collection and reporting"
,
}
FakePoWFlag
=
cli
.
BoolFlag
{
Name
:
"fakepow"
,
Usage
:
"Disables proof-of-work verification"
,
}
// RPC settings
RPCEnabledFlag
=
cli
.
BoolFlag
{
...
...
@@ -842,11 +847,13 @@ func MakeChain(ctx *cli.Context) (chain *core.BlockChain, chainDb ethdb.Database
glog
.
Fatalln
(
err
)
}
}
chainConfig
:=
MustMakeChainConfigFromDb
(
ctx
,
chainDb
)
var
eventMux
event
.
TypeMux
chain
,
err
=
core
.
NewBlockChain
(
chainDb
,
chainConfig
,
ethash
.
New
(),
&
eventMux
)
pow
:=
pow
.
PoW
(
core
.
FakePow
{})
if
!
ctx
.
GlobalBool
(
FakePoWFlag
.
Name
)
{
pow
=
ethash
.
New
()
}
chain
,
err
=
core
.
NewBlockChain
(
chainDb
,
chainConfig
,
pow
,
new
(
event
.
TypeMux
))
if
err
!=
nil
{
Fatalf
(
"Could not start chainmanager: %v"
,
err
)
}
...
...
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