Skip to content

Add environment-based network configuration#195

Merged
Mosas2000 merged 1 commit intomainfrom
fix/network-env-config
Mar 26, 2026
Merged

Add environment-based network configuration#195
Mosas2000 merged 1 commit intomainfrom
fix/network-env-config

Conversation

@Mosas2000
Copy link
Copy Markdown
Owner

Fixes #32

Changes:

  • Network now read from NEXT_PUBLIC_NETWORK env var
  • Contract address configurable via NEXT_PUBLIC_CONTRACT_ADDRESS
  • API URLs auto-selected based on network
  • Added comprehensive NETWORK_CONFIG.md guide
  • Updated .env.example with testnet example

Benefits:

  • Switch mainnet/testnet without code changes
  • Set up via .env.local file
  • Ready for deployment environments

- Read network from NEXT_PUBLIC_NETWORK env variable (mainnet/testnet)
- Support configurable contract address via NEXT_PUBLIC_CONTRACT_ADDRESS
- Auto-select API URLs based on network with optional override
- Update .env.example with testnet instructions and CONTRACT_NAME
- Add NETWORK_CONFIG.md documentation with complete setup guide

Developers can now switch networks by editing .env.local without code changes.
@Mosas2000 Mosas2000 merged commit a064d22 into main Mar 26, 2026
14 of 26 checks passed
@Mosas2000 Mosas2000 deleted the fix/network-env-config branch March 26, 2026 04:40
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.

Frontend: Network is hardcoded to StacksMainnet with no testnet or devnet toggle

1 participant