|
|
@@ -56,6 +56,18 @@ This is a destructive action and changes the network in which you will be
|
|
|
participating.
|
|
|
|
|
|
It expects the genesis file as argument.`,
|
|
|
+ }
|
|
|
+ dumpGenesisCommand = cli.Command{
|
|
|
+ Action: utils.MigrateFlags(dumpGenesis),
|
|
|
+ Name: "dumpgenesis",
|
|
|
+ Usage: "Dumps genesis block JSON configuration to stdout",
|
|
|
+ ArgsUsage: "",
|
|
|
+ Flags: []cli.Flag{
|
|
|
+ utils.DataDirFlag,
|
|
|
+ },
|
|
|
+ Category: "BLOCKCHAIN COMMANDS",
|
|
|
+ Description: `
|
|
|
+The dumpgenesis command dumps the genesis block configuration in JSON format to stdout.`,
|
|
|
}
|
|
|
importCommand = cli.Command{
|
|
|
Action: utils.MigrateFlags(importChain),
|
|
|
@@ -227,6 +239,17 @@ func initGenesis(ctx *cli.Context) error {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
+func dumpGenesis(ctx *cli.Context) error {
|
|
|
+ genesis := utils.MakeGenesis(ctx)
|
|
|
+ if genesis == nil {
|
|
|
+ genesis = core.DefaultGenesisBlock()
|
|
|
+ }
|
|
|
+ if err := json.NewEncoder(os.Stdout).Encode(genesis); err != nil {
|
|
|
+ utils.Fatalf("could not encode genesis")
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
func importChain(ctx *cli.Context) error {
|
|
|
if len(ctx.Args()) < 1 {
|
|
|
utils.Fatalf("This command requires an argument.")
|