Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow network localhost durning graph init #1854

Open
schmidsi opened this issue Dec 18, 2024 · 5 comments
Open

Allow network localhost durning graph init #1854

schmidsi opened this issue Dec 18, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@schmidsi
Copy link
Contributor

When I try to initialize a subgraph, I'm forced to select a public chain from the registry. It's a pretty common use-case to start developing a subgraph against a local hardhat/anvil node.

$ graph init
 ›   Warning: In next major version, this flag will be removed. By default we will
 ›   stop initializing a Git repository.
? Network … localhost
Other · other network not on the list
< 112 more - type to filter >

Selecting other exits the wizard:

graph init
 ›   Warning: In next major version, this flag will be removed. By default we will
 ›   stop initializing a Git repository.
✔ Network · N/A

  The chain list is populated from the Networks Registry:

  https://github.com/graphprotocol/networks-registry

  To add a chain to the registry you can create an issue or submit a PR
@schmidsi
Copy link
Contributor Author

It should continue the flow but forcing to specify a path to an ABI file instead of trying to download the ABI from a blockexplorer in my opinion.

@YaroShkvorets
Copy link
Collaborator

YaroShkvorets commented Dec 18, 2024

Good point.
I like having "Other" option that gives you a way out if you can't find the chain you are looking for. From UX perspective.
Perhaps we can add "Local Node" as an option here.

@YaroShkvorets
Copy link
Collaborator

Just checked earlier versions of graph cli and not seeing "localhost" option. How was it handled before?

@schmidsi
Copy link
Contributor Author

It wasn't. It's a new feature request.

@matthewdarwin matthewdarwin added the enhancement New feature or request label Jan 4, 2025
@YaroShkvorets YaroShkvorets moved this to 🔖 Next in Tooling Jan 8, 2025
@YaroShkvorets
Copy link
Collaborator

YaroShkvorets commented Jan 13, 2025

Based on further discussions with @p-diogo the flow should go like this:

  1. User selects "Other" or "Custom" network
  2. Enters custom network ID with default being "localhost"
  3. Gets a warning with a suggestion to add this network to the registry
  4. Manually specifies ABI path, start block and contract name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🔖 Next
Development

No branches or pull requests

3 participants