Skip to content

Commit 5aad4d7

Browse files
committed
feat: genesis fetch url input for mainnet or testnet initia init
1 parent 8370f28 commit 5aad4d7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

models/weaveinit/run_l1_node.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ func (m *RunL1NodeMonikerInput) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
148148
input, cmd, done := m.TextInput.Update(msg)
149149
if done {
150150
m.state.moniker = input.Text
151-
fmt.Println("\n[info] state", m.state)
152151
return NewExistingAppChecker(m.state), utils.DoTick()
153152
}
154153
m.TextInput = input
@@ -482,8 +481,7 @@ func (m *ExistingGenesisReplaceSelect) Update(msg tea.Msg) (tea.Model, tea.Cmd)
482481
// TODO: Continue
483482
fmt.Println("\n[info] Using current genesis")
484483
case ReplaceGenesis:
485-
// TODO: Continue
486-
fmt.Println("\n[info] Replacing genesis")
484+
return NewGenesisEndpointInput(m.state), nil
487485
}
488486
return m, tea.Quit
489487
}
@@ -531,7 +529,11 @@ func (m *GenesisEndpointInput) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
531529
}
532530

533531
func (m *GenesisEndpointInput) View() string {
534-
return fmt.Sprintf("i There is no config/genesis.json available. You will need to enter the required information to proceed.\n\n? Please specify the endpoint to fetch genesis.json\n> %s\n", m.TextInput.View())
532+
preText := ""
533+
if !m.state.existingGenesis {
534+
preText += "i There is no config/genesis.json available. You will need to enter the required information to proceed.\n\n"
535+
}
536+
return fmt.Sprintf("%s? Please specify the endpoint to fetch genesis.json\n> %s\n", preText, m.TextInput.View())
535537
}
536538

537539
type InitializingAppLoading struct {

0 commit comments

Comments
 (0)