Skip to content

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

Open
osasfaith wants to merge 1 commit into
Neurowealth:mainfrom
osasfaith:feat/stellar-network-env-switching
Open

Add Stellar testnet/mainnet environment switching without code changes#262
osasfaith wants to merge 1 commit into
Neurowealth:mainfrom
osasfaith:feat/stellar-network-env-switching

Conversation

@osasfaith

Copy link
Copy Markdown

Closes #238

Type of Change

  • New feature (non-breaking change that adds functionality)
  • Refactoring (no functional or behavioral changes)

Summary

This PR adds a single STELLAR_NETWORK env var that automatically derives the RPC URL, passphrase, and explorer URL for testnet/mainnet/futurenet without requiring multiple environment variable changes. The RPC URL defaults to the official Stellar Soroban endpoint for the configured network, with optional overrides via STELLAR_RPC_URL for custom nodes.

Motivation / Context

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. This PR consolidates network configuration into a single STELLAR_NETWORK variable with startup validation.

Closes #238

- Add STELLAR_NETWORK-based RPC URL derivation with env var overrides
- Add startup validation for network/keypair consistency
- Log active network prominently at startup
- Update .env.example to reflect optional STELLAR_RPC_URL
- Add unit tests for network configuration

Closes Neurowealth#238
@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@osasfaith Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Add Stellar testnet/mainnet environment switching without code changes

1 participant