Skip to content

Commit d36e9dd

Browse files
committed
fix: correct initia config path
1 parent 90188b1 commit d36e9dd

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

models/weaveinit/run_l1_node.go

+14-4
Original file line numberDiff line numberDiff line change
@@ -763,22 +763,32 @@ func initializeApp(state *RunL1NodeState) tea.Cmd {
763763
}
764764
}
765765

766-
if err := utils.UpdateTomlValue(filepath.Join(utils.InitiaConfigDirectory, "app.toml"), "minimum-gas-prices", state.minGasPrice); err != nil {
766+
initiaConfigPath := filepath.Join(userHome, utils.InitiaConfigDirectory)
767+
768+
if err := utils.UpdateTomlValue(filepath.Join(initiaConfigPath, "app.toml"), "minimum-gas-prices", state.minGasPrice); err != nil {
767769
panic(fmt.Sprintf("failed to update minimum-gas-prices: %v", err))
768770
}
769771

770-
if err := utils.UpdateTomlValue(filepath.Join(utils.InitiaConfigDirectory, "app.toml"), "api.enable", strconv.FormatBool(state.enableLCD)); err != nil {
772+
if err := utils.UpdateTomlValue(filepath.Join(initiaConfigPath, "app.toml"), "api.enable", strconv.FormatBool(state.enableLCD)); err != nil {
771773
panic(fmt.Sprintf("failed to update api enable: %v", err))
772774
}
773775

774-
if err := utils.UpdateTomlValue(filepath.Join(utils.InitiaConfigDirectory, "config.toml"), "p2p.seeds", state.seeds); err != nil {
776+
if err := utils.UpdateTomlValue(filepath.Join(initiaConfigPath, "config.toml"), "p2p.seeds", state.seeds); err != nil {
775777
panic(fmt.Sprintf("failed to update seeds: %v", err))
776778
}
777779

778-
if err := utils.UpdateTomlValue(filepath.Join(utils.InitiaConfigDirectory, "config.toml"), "p2p.persistent_peers", state.persistentPeers); err != nil {
780+
if err := utils.UpdateTomlValue(filepath.Join(initiaConfigPath, "config.toml"), "p2p.persistent_peers", state.persistentPeers); err != nil {
779781
panic(fmt.Sprintf("failed to update persistent_peers: %v", err))
780782
}
781783

784+
if state.genesisEndpoint != "" {
785+
if err := utils.DownloadFile(filepath.Join(utils.WeaveDataDirectory, "genesis.json"), state.genesisEndpoint); err != nil {
786+
panic(fmt.Sprintf("failed to download genesis.json: %v", err))
787+
}
788+
789+
// TODO: Continue with the rest of the genesis.json setup
790+
}
791+
782792
return utils.EndLoading{}
783793
}
784794
}

0 commit comments

Comments
 (0)