@@ -17,6 +17,7 @@ import (
17
17
18
18
const (
19
19
flagHeight = "height"
20
+ flagForZeroHeight = "for-zero-height"
20
21
flagJailAllowedAddrs = "jail-allowed-addrs"
21
22
)
22
23
@@ -56,14 +57,15 @@ func ExportCmd(app ExportableApp) *cobra.Command {
56
57
}
57
58
58
59
height , _ := cmd .Flags ().GetInt64 (flagHeight )
60
+ forZeroHeight , _ := cmd .Flags ().GetBool (flagForZeroHeight )
59
61
jailAllowedAddrs , _ := cmd .Flags ().GetStringSlice (flagJailAllowedAddrs )
60
62
outputDocument , _ := cmd .Flags ().GetString (flags .FlagOutputDocument )
61
63
if height != - 1 {
62
64
if err := app .LoadHeight (uint64 (height )); err != nil {
63
65
return err
64
66
}
65
67
}
66
- exported , err := app .ExportAppStateAndValidators (jailAllowedAddrs )
68
+ exported , err := app .ExportAppStateAndValidators (forZeroHeight , jailAllowedAddrs )
67
69
if err != nil {
68
70
return fmt .Errorf ("error exporting state: %w" , err )
69
71
}
@@ -105,6 +107,7 @@ func ExportCmd(app ExportableApp) *cobra.Command {
105
107
StringSlice (flagJailAllowedAddrs , []string {}, "Comma-separated list of operator addresses of jailed validators to unjail" )
106
108
cmd .Flags ().
107
109
String (flags .FlagOutputDocument , "" , "Exported state is written to the given file instead of STDOUT" )
110
+ cmd .Flags ().Bool (flagForZeroHeight , false , "Export state to start at height zero (perform preproccessing)" )
108
111
109
112
return cmd
110
113
}
0 commit comments