Skip to content

Add devnet/mainnet network switcher (combo app)#39

Open
abhay wants to merge 1 commit into
mainfrom
combo-app-network-switcher
Open

Add devnet/mainnet network switcher (combo app)#39
abhay wants to merge 1 commit into
mainfrom
combo-app-network-switcher

Conversation

@abhay

@abhay abhay commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Ship one app that carries both the devnet and mainnet relay configs with a runtime switcher, replacing the separate devnet bundle.

  • Network model: a first-class Network enum (Core) is the source of truth; NetworkConfig derives the relay, Explorer, websocket, and airdrop support per network. Both relay URLs are baked into the app Info.plist.
  • Reactive swap: NetworkSettingsStore owns the selected network and derives the IndexerEnvironment from it. Switching rebuilds SquadsService (a fresh instance flushes the squad, proposal, and activity caches) and realigns the relay URL. Signers are network-agnostic and persist across a switch.
  • Migration: fresh installs default to mainnet; installs that already have signers stay on devnet. The stored preference is authoritative thereafter.
  • Switcher UX: an amber-weighted devnet/mainnet control in Settings, Network with the self-hosted relay beneath it. Switching to mainnet asks for a caution confirmation (a distinct amber sheet, not the red destructive one), and the signing sheets carry a network row that marks mainnet as real funds. A persistent network chip, the home footer, and the relay-card cluster label all follow the selected network.
  • Targets: the Cosign target becomes the combo (both URLs, neutral icon); the separate CosignDevnet target is retired.
  • Mainnet relay: adds core/fly.mainnet.toml (cosign-relay-mainnet); the Helius mainnet upstream is a Fly secret, never in the repo.

Ship one app that carries both the devnet and mainnet relay configs with a
runtime switcher, replacing the separate devnet bundle.

- Network model: a first-class Network enum (Core) is the source of truth;
  NetworkConfig derives the relay, Explorer, websocket, and airdrop support
  per network. Both relay URLs are baked into the app Info.plist.
- Reactive swap: NetworkSettingsStore owns the selected network and derives
  the IndexerEnvironment from it. Switching rebuilds SquadsService (a fresh
  instance flushes the squad, proposal, and activity caches) and realigns the
  relay URL. Signers are network-agnostic and persist across a switch.
- Migration: fresh installs default to mainnet; installs that already have
  signers stay on devnet. The stored preference is authoritative thereafter.
- Switcher UX: an amber-weighted devnet/mainnet control in Settings, Network
  with the self-hosted relay beneath it. Switching to mainnet asks for a
  caution confirmation (a distinct amber sheet, not the red destructive one),
  and the signing sheets carry a network row that marks mainnet as real funds.
  A persistent network chip, the home footer, and the relay-card cluster label
  all follow the selected network.
- Targets: the Cosign target becomes the combo (both URLs, neutral icon);
  the separate CosignDevnet target is retired.
- Mainnet relay: adds core/fly.mainnet.toml (cosign-relay-mainnet); the
  Helius mainnet upstream is a Fly secret, never in the repo.
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

Successfully merging this pull request may close these issues.

1 participant