Skip to content

Commit

Permalink
Registry support (#1788)
Browse files Browse the repository at this point in the history
* Use network registry and remove hard-coded list of supported chains
* Replace studio url in examples
* Improve CLI prompts: type to filter networks and use `ESC` key to go back a step
* Warning for Near chains
* Update scaffolded package version
* Hide init subgraph option
* Remove babel config

---------

Co-authored-by: Etienne Donneger <[email protected]>
  • Loading branch information
YaroShkvorets and 0237h authored Dec 10, 2024
1 parent 7faa309 commit edb601d
Show file tree
Hide file tree
Showing 34 changed files with 8,901 additions and 2,516 deletions.
11 changes: 11 additions & 0 deletions .changeset/new-gorillas-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@graphprotocol/graph-cli': minor
---

- add networks registry support
- improve `graph init` flow
- filter through the networks as you type
- more information about the networks
- remove unnecessary options depending on the selection
- ESC key to go back
- allow specifying ipfs/url for substreams package
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ generated
packages/cli/tests/cli/init
packages/cli/tests/cli/validation
packages/cli/tests/cli/add
packages/cli/config/TheGraphNetworksRegistry.json
pnpm-lock.yaml
website/src/graphql-env.d.ts
4 changes: 2 additions & 2 deletions examples/aggregations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"scripts": {
"build": "graph build",
"codegen": "graph codegen",
"create": "graph create example --node https://api.thegraph.com/deploy/",
"create": "graph create example --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create example --node http://127.0.0.1:8020",
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy example --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"test": "graph test"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/arweave-blocks-transactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"scripts": {
"build": "graph build",
"codegen": "graph codegen",
"create": "graph create arweave-example --node https://api.thegraph.com/deploy/",
"create": "graph create arweave-example --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create arweave-example --node http://localhost:8020",
"deploy": "graph deploy arweave-example --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy arweave-example --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy arweave-example -l v0.1.0 --ipfs http://localhost:5001 --node http://localhost:8020",
"remove-local": "graph remove arweave-example --node http://localhost:8020"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/cosmos-block-filtering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"scripts": {
"build": "graph build",
"codegen": "graph codegen",
"create": "graph create cosmos-block-filtering --node https://api.thegraph.com/deploy/",
"create": "graph create cosmos-block-filtering --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create cosmos-block-filtering --node http://127.0.0.1:8020",
"deploy": "graph deploy cosmos-block-filtering --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy cosmos-block-filtering --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy cosmos-block-filtering -l v0.1.0 --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"prepare:cosmoshub": "mustache config/cosmoshub.json subgraph.template.yaml > subgraph.yaml",
"prepare:osmosis": "mustache config/osmosis.json subgraph.template.yaml > subgraph.yaml",
Expand Down
4 changes: 2 additions & 2 deletions examples/cosmos-osmosis-token-swaps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"scripts": {
"build": "graph build",
"codegen": "graph codegen",
"create": "graph create osmosis-token-swaps --node https://api.thegraph.com/deploy/",
"create": "graph create osmosis-token-swaps --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create osmosis-token-swaps --node http://0.0.0.0:8020",
"deploy": "graph deploy osmosis-token-swaps --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy osmosis-token-swaps --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy osmosis-token-swaps -l v0.1.0 --ipfs http://0.0.0.0:5001 --node http://0.0.0.0:8020",
"remove-local": "graph remove osmosis-token-swaps --node http://0.0.0.0:8020"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/cosmos-validator-delegations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"scripts": {
"build": "graph build",
"codegen": "graph codegen",
"create": "graph create cosmos-validator-delegations --node https://api.thegraph.com/deploy/",
"create": "graph create cosmos-validator-delegations --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create cosmos-validator-delegations --node http://127.0.0.1:8020",
"deploy": "graph deploy cosmos-validator-delegations --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy cosmos-validator-delegations --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy cosmos-validator-delegations -l v0.1.0 --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"prepare:cosmoshub": "mustache config/cosmoshub.json subgraph.template.yaml > subgraph.yaml",
"prepare:osmosis": "mustache config/osmosis.json subgraph.template.yaml > subgraph.yaml",
Expand Down
4 changes: 2 additions & 2 deletions examples/cosmos-validator-rewards/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"scripts": {
"build": "graph build",
"codegen": "graph codegen",
"create": "graph create cosmos-validator-rewards --node https://api.thegraph.com/deploy/",
"create": "graph create cosmos-validator-rewards --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create cosmos-validator-rewards --node http://127.0.0.1:8020",
"deploy": "graph deploy cosmos-validator-rewards --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy cosmos-validator-rewards --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy cosmos-validator-rewards -l v0.1.0 --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"prepare:cosmoshub": "mustache config/cosmoshub.json subgraph.template.yaml > subgraph.yaml",
"prepare:osmosis": "mustache config/osmosis.json subgraph.template.yaml > subgraph.yaml",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const path = require('node:path');
const { system, patching, filesystem } = require('gluegun');
const { createApolloFetch } = require('apollo-fetch');
const { ethers } = require('hardhat');
const { expect } = require('chai');
import path from 'node:path';
import { createApolloFetch } from 'apollo-fetch';
import { expect } from 'chai';
import { filesystem, patching, system } from 'gluegun';
import { ethers } from 'hardhat';

const srcDir = path.join(__dirname, '..');

Expand Down Expand Up @@ -56,7 +56,7 @@ describe('Basic event handlers', () => {
await patching.replace(
path.join(srcDir, 'subgraph.yaml'),
'DEPLOYED_CONTRACT_ADDRESS',
registry.target,
String(registry.target),
);

await registry.setMythicalGravatar();
Expand Down
3 changes: 2 additions & 1 deletion examples/ethereum-basic-event-handlers/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "dist"
"outDir": "dist",
"esModuleInterop": true
}
}
4 changes: 2 additions & 2 deletions examples/ethereum-gravatar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"build": "graph build",
"build:contract": "hardhat compile",
"codegen": "graph codegen",
"create": "graph create example --node https://api.thegraph.com/deploy/",
"create": "graph create example --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create example --node http://127.0.0.1:8020",
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy example --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions examples/near-blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"scripts": {
"build": "graph build",
"codegen": "graph codegen",
"create": "graph create example --node https://api.thegraph.com/deploy/",
"create": "graph create example --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create example --node http://127.0.0.1:8020",
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy example --ipfs http://localhost:5001 --node http://127.0.0.1:8020"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions examples/near-receipts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"scripts": {
"build": "graph build",
"codegen": "graph codegen",
"create": "graph create example --node https://api.thegraph.com/deploy/",
"create": "graph create example --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create example --node http://127.0.0.1:8020",
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy example --ipfs http://localhost:5001 --node http://127.0.0.1:8020"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit edb601d

Please sign in to comment.