Skip to content

Run one indexer loop per configured network #161

Description

@Miracle656

Background

startIndexer() runs a single loop with module-global state (totalIndexed, pollCycleCount, startedAt) and resolves one set of watched contracts. Depends on W070 (network column) and W071 (per-network RPC). To index both networks in one process, the loop must run once per network with isolated state and its own RPC + watch-list + passphrase.

What to build

Parameterize the indexer by network and launch one loop instance per configured network.

Key files

  • src/indexer.tsstartIndexer() (206-286), resolveSacContractIds() (51-71), DEFAULT_XLM_SAC_MAINNET/TESTNET (35-38)
  • src/ingester/nft.ts — passphrase selection (122-124)

Suggested execution

git checkout -b feat/multi-network-indexer
  1. Make startIndexer(network) take a network; move per-loop counters into local state
  2. Use getRpc(network) (W071) and the network's passphrase (Networks.PUBLIC/TESTNET)
  3. Read the enabled networks from env (e.g. NETWORKS=testnet,mainnet) and start a loop for each
  4. Ensure writes tag network (W070)

Acceptance criteria

  • Two loops run concurrently without shared mutable state
  • Each writes rows tagged with its own network
  • /status reports per-network progress
  • Single-network mode still works when only one is enabled

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions