0g-chain/app/utils.go
rhuairahrighairigh 5acc23e6e5 update app package
2019-09-11 18:33:20 -04:00

18 lines
361 B
Go

package app
import (
"fmt"
"io/ioutil"
)
// ExportStateToJSON util function to export the app state to JSON
func ExportStateToJSON(app *App, path string) error {
fmt.Println("exporting app state...")
appState, _, err := app.ExportAppStateAndValidators(false, nil)
if err != nil {
return err
}
return ioutil.WriteFile(path, []byte(appState), 0644)
}