SprintFund supports both Stacks Mainnet and Testnet environments via environment variables.
-
Copy
.env.exampleto.env.local:cp .env.example .env.local
-
Edit
.env.localto set your network:NEXT_PUBLIC_NETWORK=mainnet # or testnet NEXT_PUBLIC_CONTRACT_ADDRESS=SP31PKQVQZVZCK3FM3NH67CGD6G1FMR17VQVS2W5T
- Type:
mainnet|testnet - Default:
mainnet - Description: Determines which Stacks network to connect to
- Type: String (Stacks address)
- Default:
SP31PKQVQZVZCK3FM3NH67CGD6G1FMR17VQVS2W5T(mainnet) - Description: The deployed contract address for your network
- Type: String
- Default:
sprintfund-core - Description: The contract name (optional)
- Type: URL string
- Default: Auto-selected based on
NEXT_PUBLIC_NETWORK- Mainnet:
https://stacks-node-api.mainnet.stacks.co - Testnet:
https://stacks-node-api.testnet.stacks.co
- Mainnet:
- Description: Stacks API endpoint (optional override)
NEXT_PUBLIC_NETWORK=mainnet
NEXT_PUBLIC_CONTRACT_ADDRESS=SP31PKQVQZVZCK3FM3NH67CGD6G1FMR17VQVS2W5T
NEXT_PUBLIC_CONTRACT_NAME=sprintfund-coreNEXT_PUBLIC_NETWORK=testnet
NEXT_PUBLIC_CONTRACT_ADDRESS=ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
NEXT_PUBLIC_CONTRACT_NAME=sprintfund-coreTo test network configuration:
# Test mainnet
NEXT_PUBLIC_NETWORK=mainnet npm run dev
# Test testnet
NEXT_PUBLIC_NETWORK=testnet npm run devThe network configuration is centralized in src/config.ts:
- All network-specific settings are derived from
NEXT_PUBLIC_NETWORK - API URLs auto-select based on network
- Contract address can be overridden per environment
- No code changes needed to switch networks
For production deployments, create .env.production.local:
cp .env.production .env.production.local
# Edit with your production valuesFor staging deployments, use .env.staging.local:
cp .env.staging .env.staging.local
# Edit with your staging valuesNever commit .env.*.local files to version control.