-
Notifications
You must be signed in to change notification settings - Fork 36
Restructure config.ts into a per-network config map #113
Copy link
Copy link
Open
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programarea:ingestSDEX / AMM ingestionSDEX / AMM ingestiondifficulty:advancedMulti-day projectMulti-day projecthelp wantedExtra attention is neededExtra attention is neededpoints:200Advanced tier — 200 Wave pointsAdvanced tier — 200 Wave points
Description
Activity
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programarea:ingestSDEX / AMM ingestionSDEX / AMM ingestiondifficulty:advancedMulti-day projectMulti-day projecthelp wantedExtra attention is neededExtra attention is neededpoints:200Advanced tier — 200 Wave pointsAdvanced tier — 200 Wave points
Background
src/config.tsbuilds a single frozen config object at import — one Horizon, one RPC, one passphrase, one Soroswap factory. Worse, the defaults are incoherent:HORIZON_URL/RPC_URLdefault to testnet while the Soroswap factory, Reflector oracle and Aquarius API default to mainnet addresses. Dual-network needs config resolved per network, not one flat object.What to build
Replace the flat config with
config.networks.{testnet,mainnet}, each carryinghorizon.url,rpc.url,network.passphrase,soroswap.factoryAddress, oracle ids, and watched pairs — from paired env vars.Key files
src/config.ts(31-72)Suggested execution
HORIZON_URL_{TESTNET,MAINNET},RPC_URL_*,NETWORK_PASSPHRASE_*,SOROSWAP_FACTORY_ADDRESS_*,REFLECTOR_CONTRACT_ID_*,WATCHED_PAIRS_*getNetworkConfig(network); keep single-var fallback.env.examplewith both networksAcceptance criteria
config.networks.testnetand.mainneteach fully specified.env.exampledocuments bothRequired: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk