Skip to content

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

Merged
abhay merged 1 commit into
mainfrom
combo-app-network-switcher
Jul 12, 2026
Merged

Add devnet/mainnet network switcher (combo app)#39
abhay merged 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.

@abhay abhay force-pushed the combo-app-network-switcher branch 2 times, most recently from f22e6e4 to 6cd8b09 Compare July 12, 2026 18:03
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.
- Marketing: reposition the landing page from devnet-only to the combo app,
  with a "one app, two networks" section and a safety story built on
  on-device keys, decode-before-signing, and verifiable builds.
- Canonical marketing: the devnet relay's landing paths (/, /privacy, assets)
  301-redirect to the single canonical host via COSIGN_LANDING_REDIRECT, so the
  marketing site has one home; the relay's RPC role for devnet Solana is
  unaffected and the mainnet relay stays canonical.
@abhay abhay force-pushed the combo-app-network-switcher branch from 6cd8b09 to cf456f1 Compare July 12, 2026 18:37
@abhay abhay enabled auto-merge (squash) July 12, 2026 18:38
@abhay abhay merged commit 0b88eee into main Jul 12, 2026
6 checks passed
@abhay abhay deleted the combo-app-network-switcher branch July 12, 2026 18:41
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