Skip to content

Add a network selector to the REST / GraphQL / WS API #163

Description

@Miracle656

Background

No route namespaces by network — /accounts, /summary/:address, /subscribe/:address, /graphql all hit the single global RPC/DB. Once storage and indexing are network-aware (W070–W072), the API must let callers pick a network (default testnet for back-compat).

What to build

Accept a network via ?network= (and/or a path segment) and thread it into RPC + DB reads.

Key files

  • src/api.ts — routes (98-111, 157-763), getLatestLedger uses (189, 199, 227)
  • GraphQL resolvers

Suggested execution

git checkout -b feat/api-network-selector
  1. Parse network from query/header; validate against enabled networks; default testnet
  2. Pass it to DB queries (W070) and getRpc(network) (W071)
  3. Document the param in the OpenAPI spec

Acceptance criteria

  • ?network=mainnet returns mainnet data; default stays testnet
  • Invalid network → 400 with a clear message
  • /readyz / /status report per-network health
  • OpenAPI updated

Drips Wave · Complexity: Intermediate · 150 points


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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions