Summary
Switching between Stellar testnet and mainnet currently requires changing multiple environment variables manually with no validation that the full set is consistent. A misconfiguration (testnet key against mainnet RPC) could be catastrophic.
Proposed Solution
- Add a single
STELLAR_NETWORK env var: testnet | mainnet | futurenet
- In
src/stellar/client.ts, derive the RPC URL, passphrase, and explorer URL from this single value (with env var overrides for custom nodes)
- Add startup validation in
src/config/readiness.ts that verifies the keypair matches the expected network
- Log the active network prominently at startup
Acceptance Criteria
Summary
Switching between Stellar testnet and mainnet currently requires changing multiple environment variables manually with no validation that the full set is consistent. A misconfiguration (testnet key against mainnet RPC) could be catastrophic.
Proposed Solution
STELLAR_NETWORKenv var:testnet|mainnet|futurenetsrc/stellar/client.ts, derive the RPC URL, passphrase, and explorer URL from this single value (with env var overrides for custom nodes)src/config/readiness.tsthat verifies the keypair matches the expected networkAcceptance Criteria
STELLAR_NETWORK=testnetsets all Stellar config correctly.env.exampleupdated; individual Stellar URL vars become optional overrides