Skip to content

Add Stellar testnet/mainnet environment switching without code changes #238

Description

@robertocarlous

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

  • STELLAR_NETWORK=testnet sets all Stellar config correctly
  • Startup validation rejects keypair/network mismatch with a clear error message
  • .env.example updated; individual Stellar URL vars become optional overrides
  • Unit tests verify derived config for each network value

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions