Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jewei1997 committed Jul 29, 2024
1 parent db06037 commit 5b0783a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ type GenesisConfig struct {
// StreamImport defines if the genesis.json is in stream form or not.
StreamImport bool `mapstructure:"stream-import"`

// ImportFile sets the genesis json file from which to stream from
ImportFile string `mapstructure:"import-file"`
// GenesisStreamFile sets the genesis json file from which to stream from
GenesisStreamFile string `mapstructure:"genesis-stream-file"`
}

// Config defines the server's top level configuration
Expand Down Expand Up @@ -299,8 +299,8 @@ func DefaultConfig() *Config {
StateCommit: config.DefaultStateCommitConfig(),
StateStore: config.DefaultStateStoreConfig(),
Genesis: GenesisConfig{
StreamImport: false,
ImportFile: "",
StreamImport: false,
GenesisStreamFile: "",
},
}
}
Expand Down Expand Up @@ -406,8 +406,8 @@ func GetConfig(v *viper.Viper) (Config, error) {
ImportNumWorkers: v.GetInt("state-store.import-num-workers"),
},
Genesis: GenesisConfig{
StreamImport: v.GetBool("genesis.stream-import"),
ImportFile: v.GetString("genesis.import-file"),
StreamImport: v.GetBool("genesis.stream-import"),
GenesisStreamFile: v.GetString("genesis.genesis-stream-file"),
},
}, nil
}
Expand Down
4 changes: 2 additions & 2 deletions server/config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ snapshot-directory = "{{ .StateSync.SnapshotDirectory }}"
# file must be in stream form and exported in a streaming fashion.
stream-import = {{ .Genesis.StreamImport }}
# import-file specifies the path of the genesis json file to stream from.
import-file = "{{ .Genesis.ImportFile }}"
# genesis-stream-file specifies the path of the genesis json file to stream from.
genesis-stream-file = "{{ .Genesis.ImportFile }}"
` + config.DefaultConfigTemplate

var configTemplate *template.Template
Expand Down
2 changes: 1 addition & 1 deletion server/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func ExportCmd(appExporter types.AppExporter, defaultNodeHome string) *cobra.Com
}

if isStreaming && streamingFile == "" {
return fmt.Errorf("file to export stream to not provided")
return fmt.Errorf("file to export stream to not provided, please specify --streaming-file")
}

db, err := openDB(config.RootDir)
Expand Down
4 changes: 2 additions & 2 deletions server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,11 @@ func startInProcess(
ctx.Logger.Info("starting node with ABCI Tendermint in-process")
var gen *tmtypes.GenesisDoc
if config.Genesis.StreamImport {
lines := genesistypes.IngestGenesisFileLineByLine(config.Genesis.ImportFile)
lines := genesistypes.IngestGenesisFileLineByLine(config.Genesis.GenesisStreamFile)
for line := range lines {
genDoc, err := tmtypes.GenesisDocFromJSON([]byte(line))
if err != nil {
continue
return err
}
if gen != nil {
return fmt.Errorf("error: multiple genesis docs found in stream")
Expand Down

0 comments on commit 5b0783a

Please sign in to comment.