Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support switching between networks #142

Open
danielnordh opened this issue Dec 10, 2024 · 1 comment
Open

Feature Request: Support switching between networks #142

danielnordh opened this issue Dec 10, 2024 · 1 comment

Comments

@danielnordh
Copy link
Contributor

danielnordh commented Dec 10, 2024

It would be great if the app allows for switching between networks after onboarding.
Ideally also esplora servers.

Currently, a user must decide before onboarding what network they want to use, and to use another must delete the seed and any data.

Given that this may brake existing users' installation it could be worth doing this a.s.a.p.
(Would be possible to have a fallback to migrate over previous installations, not sure if worth the effort)

Desired flow

  1. User has onboarded with Signet settings
  2. They now want to try something on Testnet, or Bitcoin
  3. By going to Settings -> Network settings, they can switch to the desired network
  • Node is stopped
  • Node is restarted with desired network (same seed if possible?)
  1. The user can later switch back to Signet and all data should be restored

Things that are likely to be needed for this to work

  • Each network needs to save data into different directories
  • Last used network needs to be stored somewhere for startup to know
  • Backup info may need more info stored?
  • OnboardingViewModel should be refactored to enable NetworkSettingsView to be reused
/// LightningNodeService.swift
var config = defaultConfig()
config.storageDirPath = FileManager.default.getDocumentsDirectoryPath() // add network specifics 
config.logDirPath = FileManager.default.getDocumentsDirectoryPath() // add network specifics 
@danielnordh
Copy link
Contributor Author

When updating the SettingsView I wanted to reuse the NetworkSettingsView available from the OnboardingView.
But since that uses the OnboardingViewModel it would need to be refactored.

OnboardingViewModel gets/sets the network in KeyClient, which gets/sets it in KeyService.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant