@@ -763,22 +763,32 @@ func initializeApp(state *RunL1NodeState) tea.Cmd {
763
763
}
764
764
}
765
765
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 {
767
769
panic (fmt .Sprintf ("failed to update minimum-gas-prices: %v" , err ))
768
770
}
769
771
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 {
771
773
panic (fmt .Sprintf ("failed to update api enable: %v" , err ))
772
774
}
773
775
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 {
775
777
panic (fmt .Sprintf ("failed to update seeds: %v" , err ))
776
778
}
777
779
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 {
779
781
panic (fmt .Sprintf ("failed to update persistent_peers: %v" , err ))
780
782
}
781
783
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
+
782
792
return utils.EndLoading {}
783
793
}
784
794
}
0 commit comments