Skip to content

Restructure config.ts into a per-network config map #113

Open

Description

@Miracle656

Background

src/config.ts builds a single frozen config object at import — one Horizon, one RPC, one passphrase, one Soroswap factory. Worse, the defaults are incoherent: HORIZON_URL/RPC_URL default 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 carrying horizon.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

git checkout -b feat/per-network-config
  1. Read paired env: HORIZON_URL_{TESTNET,MAINNET}, RPC_URL_*, NETWORK_PASSPHRASE_*, SOROSWAP_FACTORY_ADDRESS_*, REFLECTOR_CONTRACT_ID_*, WATCHED_PAIRS_*
  2. Expose getNetworkConfig(network); keep single-var fallback
  3. Update .env.example with both networks

Acceptance criteria

  • config.networks.testnet and .mainnet each fully specified
  • No more incoherent testnet-RPC/mainnet-contract defaults
  • Back-compat single-network env still resolves
  • .env.example documents both

Drips Wave · Complexity: Advanced · 200 points


Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk

Activity

  1. Amas-01 commented on Aug 24, 2026

    @Amas-01

    @Amas-01 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hello Maintainer, I'll like to work on this. Please Assign me

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Amas-01 to this issue.

  2. gideonpius7-design commented on Aug 24, 2026

    @gideonpius7-design
    Contributor

    @gideonpius7-design has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    I would like to apply for this issue to refactor src/config.ts into a clean, multi-network config structure. Resolving per-network configurations will fix the current mismatch between default testnet RPCs and mainnet contract addresses while preserving backwards compatibility.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @gideonpius7-design to this issue.

  3. drips-wave commented on Aug 25, 2026

    @drips-wave

    Congratulations, @gideonpius7-design! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.

    🧑‍💻 @gideonpius7-design: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  4. added 2 commits that reference this issue on Aug 25, 2026
  5. Miracle656 commented on Oct 16, 2026

    @Miracle656
    CollaboratorAuthor

    Unassigning so this can be added to the Stellar Wave — a Wave issue can't carry an assignee from outside the programme.

    @gideonpius7-design this isn't a reassignment away from you: nothing has been submitted against it and it stays open. If you're still working on it, claim it through the Wave and it counts toward your points there. Apologies for the shuffle.

  6. Belzabeem commented on Oct 16, 2026

    @Belzabeem

    @Belzabeem has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I’d love to implement network-specific configuration with consistent endpoints and contract addresses, while preserving backward compatibility and documenting both networks in .env.example; kindly assign it to me.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Belzabeem to this issue.

  7. deslawson commented on Oct 16, 2026

    @deslawson
    Contributor

    @deslawson has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I'd love to work on this issue as it is within my experience

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @deslawson to this issue.

  8. drips-wave commented on Oct 16, 2026

    @drips-wave

    Congratulations, @Belzabeem! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

    🧑‍💻 @Belzabeem: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  9. drips-wave commented on Oct 22, 2026

    @drips-wave

    This issue has been marked as completed by a Drips Wave moderator for @Belzabeem as part of the Stellar Wave Program's 10th Wave 🥳

    Moderator's reason: [Auto-assessed] The PR is open with no maintainer response or objections across any of the four channels. The code changes correctly scope the candles query to the requested network, add comprehensive test coverage, and update the OpenAPI specifications with shared error components and dated examples.

    😎 @Belzabeem: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

    ℹ️ Note: This issue was marked complete via moderation. Points were issued even though the GitHub issue remains open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programarea:ingestSDEX / AMM ingestiondifficulty:advancedMulti-day projecthelp wantedExtra attention is neededpoints:200Advanced tier — 200 Wave points

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions