graphprotocol / graphprotocol/indexer

Refactor Agent initialization

Open
#709 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue p2
Dominant language
TypeScript
Stars
262
Forks
148
PR merge metrics
No merged PRs in 30d

Description

Currently, we require a pair of matching Operator and Network lists to instantiate the Agent object, but that could be simplified by just passing a NetworkSpecification list to its constructor.

Originally posted by @hopeyen in https://github.com/graphprotocol/indexer/pull/668#discussion_r1252066641

It seems that Networks and Operators both came from mapping on NetworkSpecification, so I would like to understand the flow to separately derive Networks and Operators from NetworkSpecification, validate their positions as two arrays, then zip into "NetworkAndOperator". Is it not possible to simply validate NetworkSpecification for its Network and Operator info directly?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Agent constructor and trace how Network and Operator lists are derived from NetworkSpecification. Follow the validation and the NetworkAndOperator pairing flow to determine the affected entry points. Done means Agent accepts a NetworkSpecification list directly while preserving validation and pairing behavior; the payload does not name specific files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.