func (app *LinkApp) ExportAppStateAndValidators(
	forZeroHeight bool, jailAllowedAddrs []string,
) (servertypes.ExportedApp, error) {
	ctx := app.NewContext(true, ostproto.Header{Height: app.LastBlockHeight()})
	height := app.LastBlockHeight() + 1
	if forZeroHeight {
		height = 0
		app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs)
	}
	genState := app.mm.ExportGenesis(ctx, app.appCodec)
	appState, err := json.MarshalIndent(genState, "", "  ")
	if err != nil {
		return servertypes.ExportedApp{}, err
	}
	validators, err := staking.WriteValidators(ctx, app.StakingKeeper)
	return servertypes.ExportedApp{
		AppState:        appState,
		Validators:      validators,
		Height:          height,
		ConsensusParams: app.BaseApp.GetConsensusParams(ctx),
	}, err
}
ExportAppStateAndValidators exports the state of the application for a genesis
file.
package app
import (
	"encoding/json"
	"log"
	ostproto "github.com/line/ostracon/proto/ostracon/types"
	servertypes "github.com/line/lbm-sdk/server/types"
	sdk "github.com/line/lbm-sdk/types"
	slashingtypes "github.com/line/lbm-sdk/x/slashing/types"
	"github.com/line/lbm-sdk/x/staking"
	stakingtypes "github.com/line/lbm-sdk/x/staking/types"
)