Skip to content

Conversation

dimitrovmaksim
Copy link
Member

@dimitrovmaksim dimitrovmaksim commented Mar 10, 2022

Resolves #837

What this PR does:

  1. graph init will now also generate networks.json from the data in subgraph.yaml file in the format specified in the linked Issue.

  2. graph build:

  • the command now accepts two more options --network <name> and --network-file <path>
  • passing the --network <name> option will update the network, address/account (NEAR uses account) and startBlock for each dataSources in subgraph.yaml to the values defined in the networks.json file. Also automatically updates all templates' (if any) network to the one passed with --network option. After that the build command will continue with the existing build functionality.
  • throws an error if networks file does not exist
  • throws an error if network not specified in networks file
  • throws an error if a given dataSource isn't in the networks.json for the specified network.
  • logs If any dataSources in the subgraph manifest are not updated
  • logs If any dataSources in the configuration file are not used

Issues:
When running yarn test, jest does not exit, but if I run every test suite separately it exits correctly

Jest has detected the following 1 open handle potentially keeping Jest from exiting:

  ●  PROCESSWRAP

      at Process.emitInitNative (node:internal/async_hooks:205:43)
      at new ChildProcess (node:internal/child_process:263:18)
      at spawn (node:child_process:695:17)
      at start (node_modules/sync-rpc/lib/index.js:33:13)
      at sendMessage (node_modules/sync-rpc/lib/index.js:133:17)
      at createClient (node_modules/sync-rpc/lib/index.js:173:27)
      at Object.<anonymous> (node_modules/sync-request/lib/index.js:16:14)

@dimitrovmaksim dimitrovmaksim marked this pull request as ready for review March 14, 2022 07:57
@evaporei
Copy link
Contributor

evaporei commented Mar 15, 2022

I just pushed a copy of your branch to trigger the CI.

I'll try to get write access to you LimeChain folks soon 🙂

Edit: it passed 🎉 , I'll try to review this between today and tomorrow 👩‍💻

@evaporei evaporei self-requested a review March 15, 2022 20:30
Copy link
Contributor

@evaporei evaporei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll approve and merge it for now so I don't block you further, we can do the fix of the HELP string later.

--skip-migrations Skip subgraph migrations (default: false)
-w, --watch Regenerate types when subgraph files change (default: false)
--network <name> Network to use from networks.json
--network-file <path> Networks file (default: "./networks.json")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is missing a space before Networks file

@evaporei evaporei merged commit 90bcd8e into graphprotocol:main Mar 22, 2022
@evaporei
Copy link
Contributor

@dimitrovmaksim I just released this on 0.29.0

Soon I'll fix the Release page in Github because we have the tags but not the release notes for them (most of them are on PRs).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Network configuration file

2 participants