From 12ebad49e2b329dae1f0ef23e5afd82e01ff0fed Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Mon, 7 May 2018 01:01:01 +0200 Subject: [PATCH 1/2] Export all genesis information (closes #946) --- server/export.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/server/export.go b/server/export.go index 3d0e49a126..dad2df9cc9 100644 --- a/server/export.go +++ b/server/export.go @@ -8,6 +8,7 @@ import ( "github.com/spf13/viper" "github.com/cosmos/cosmos-sdk/wire" + tmtypes "github.com/tendermint/tendermint/types" ) // ExportCmd dumps app state to JSON @@ -21,7 +22,16 @@ func ExportCmd(ctx *Context, cdc *wire.Codec, appExporter AppExporter) *cobra.Co if err != nil { return errors.Errorf("Error exporting state: %v\n", err) } - fmt.Println(string(appState)) + doc, err := tmtypes.GenesisDocFromFile(ctx.Config.GenesisFile()) + if err != nil { + return err + } + doc.AppStateJSON = appState + encoded, err := wire.MarshalJSONIndent(cdc, doc) + if err != nil { + return err + } + fmt.Println(string(encoded)) return nil }, } From 677a5f110806606aa475536ae7b8b1f69afb4268 Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Mon, 7 May 2018 01:05:32 +0200 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b1e67bee6..77b4ffba89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ BREAKING CHANGES FEATURES: +* Added `gaiad export` command, which exports genesis information & current state * Gaia stake commands include, DeclareCandidacy, EditCandidacy, Delegate, Unbond * MountStoreWithDB without providing a custom store works. * Repo is now lint compliant / GoMetaLinter with tendermint-lint integrated into CI