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
22082f9e
Unverified
Commit
22082f9e
authored
Mar 09, 2021
by
gary rong
Committed by
GitHub
Mar 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: extend dumpgenesis to support network flags on the cmd (#22406)
parent
3d299b74
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
chaincmd.go
cmd/geth/chaincmd.go
+6
-1
flags.go
cmd/utils/flags.go
+2
-0
No files found.
cmd/geth/chaincmd.go
View file @
22082f9e
...
...
@@ -62,7 +62,11 @@ It expects the genesis file as argument.`,
Usage
:
"Dumps genesis block JSON configuration to stdout"
,
ArgsUsage
:
""
,
Flags
:
[]
cli
.
Flag
{
utils
.
DataDirFlag
,
utils
.
MainnetFlag
,
utils
.
RopstenFlag
,
utils
.
RinkebyFlag
,
utils
.
GoerliFlag
,
utils
.
YoloV3Flag
,
},
Category
:
"BLOCKCHAIN COMMANDS"
,
Description
:
`
...
...
@@ -227,6 +231,7 @@ func initGenesis(ctx *cli.Context) error {
}
func
dumpGenesis
(
ctx
*
cli
.
Context
)
error
{
// TODO(rjl493456442) support loading from the custom datadir
genesis
:=
utils
.
MakeGenesis
(
ctx
)
if
genesis
==
nil
{
genesis
=
core
.
DefaultGenesisBlock
()
...
...
cmd/utils/flags.go
View file @
22082f9e
...
...
@@ -1773,6 +1773,8 @@ func MakeChainDatabase(ctx *cli.Context, stack *node.Node) ethdb.Database {
func
MakeGenesis
(
ctx
*
cli
.
Context
)
*
core
.
Genesis
{
var
genesis
*
core
.
Genesis
switch
{
case
ctx
.
GlobalBool
(
MainnetFlag
.
Name
)
:
genesis
=
core
.
DefaultGenesisBlock
()
case
ctx
.
GlobalBool
(
RopstenFlag
.
Name
)
:
genesis
=
core
.
DefaultRopstenGenesisBlock
()
case
ctx
.
GlobalBool
(
RinkebyFlag
.
Name
)
:
...
...
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