Skip to content

Commit edb601d

Browse files
YaroShkvorets0237h
andauthored
Registry support (#1788)
* 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]>
1 parent 7faa309 commit edb601d

File tree

34 files changed

+8901
-2516
lines changed

34 files changed

+8901
-2516
lines changed

.changeset/new-gorillas-scream.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@graphprotocol/graph-cli': minor
3+
---
4+
5+
- add networks registry support
6+
- improve `graph init` flow
7+
- filter through the networks as you type
8+
- more information about the networks
9+
- remove unnecessary options depending on the selection
10+
- ESC key to go back
11+
- allow specifying ipfs/url for substreams package

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ generated
55
packages/cli/tests/cli/init
66
packages/cli/tests/cli/validation
77
packages/cli/tests/cli/add
8+
packages/cli/config/TheGraphNetworksRegistry.json
89
pnpm-lock.yaml
910
website/src/graphql-env.d.ts

examples/aggregations/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"scripts": {
1111
"build": "graph build",
1212
"codegen": "graph codegen",
13-
"create": "graph create example --node https://api.thegraph.com/deploy/",
13+
"create": "graph create example --node https://api.studio.thegraph.com/deploy/",
1414
"create-local": "graph create example --node http://127.0.0.1:8020",
15-
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
15+
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
1616
"deploy-local": "graph deploy example --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
1717
"test": "graph test"
1818
},

examples/arweave-blocks-transactions/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
"scripts": {
1313
"build": "graph build",
1414
"codegen": "graph codegen",
15-
"create": "graph create arweave-example --node https://api.thegraph.com/deploy/",
15+
"create": "graph create arweave-example --node https://api.studio.thegraph.com/deploy/",
1616
"create-local": "graph create arweave-example --node http://localhost:8020",
17-
"deploy": "graph deploy arweave-example --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
17+
"deploy": "graph deploy arweave-example --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
1818
"deploy-local": "graph deploy arweave-example -l v0.1.0 --ipfs http://localhost:5001 --node http://localhost:8020",
1919
"remove-local": "graph remove arweave-example --node http://localhost:8020"
2020
},

examples/cosmos-block-filtering/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"scripts": {
1212
"build": "graph build",
1313
"codegen": "graph codegen",
14-
"create": "graph create cosmos-block-filtering --node https://api.thegraph.com/deploy/",
14+
"create": "graph create cosmos-block-filtering --node https://api.studio.thegraph.com/deploy/",
1515
"create-local": "graph create cosmos-block-filtering --node http://127.0.0.1:8020",
16-
"deploy": "graph deploy cosmos-block-filtering --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
16+
"deploy": "graph deploy cosmos-block-filtering --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
1717
"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",
1818
"prepare:cosmoshub": "mustache config/cosmoshub.json subgraph.template.yaml > subgraph.yaml",
1919
"prepare:osmosis": "mustache config/osmosis.json subgraph.template.yaml > subgraph.yaml",

examples/cosmos-osmosis-token-swaps/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"scripts": {
1212
"build": "graph build",
1313
"codegen": "graph codegen",
14-
"create": "graph create osmosis-token-swaps --node https://api.thegraph.com/deploy/",
14+
"create": "graph create osmosis-token-swaps --node https://api.studio.thegraph.com/deploy/",
1515
"create-local": "graph create osmosis-token-swaps --node http://0.0.0.0:8020",
16-
"deploy": "graph deploy osmosis-token-swaps --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
16+
"deploy": "graph deploy osmosis-token-swaps --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
1717
"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",
1818
"remove-local": "graph remove osmosis-token-swaps --node http://0.0.0.0:8020"
1919
},

examples/cosmos-validator-delegations/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"scripts": {
1212
"build": "graph build",
1313
"codegen": "graph codegen",
14-
"create": "graph create cosmos-validator-delegations --node https://api.thegraph.com/deploy/",
14+
"create": "graph create cosmos-validator-delegations --node https://api.studio.thegraph.com/deploy/",
1515
"create-local": "graph create cosmos-validator-delegations --node http://127.0.0.1:8020",
16-
"deploy": "graph deploy cosmos-validator-delegations --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
16+
"deploy": "graph deploy cosmos-validator-delegations --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
1717
"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",
1818
"prepare:cosmoshub": "mustache config/cosmoshub.json subgraph.template.yaml > subgraph.yaml",
1919
"prepare:osmosis": "mustache config/osmosis.json subgraph.template.yaml > subgraph.yaml",

examples/cosmos-validator-rewards/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"scripts": {
1212
"build": "graph build",
1313
"codegen": "graph codegen",
14-
"create": "graph create cosmos-validator-rewards --node https://api.thegraph.com/deploy/",
14+
"create": "graph create cosmos-validator-rewards --node https://api.studio.thegraph.com/deploy/",
1515
"create-local": "graph create cosmos-validator-rewards --node http://127.0.0.1:8020",
16-
"deploy": "graph deploy cosmos-validator-rewards --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
16+
"deploy": "graph deploy cosmos-validator-rewards --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
1717
"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",
1818
"prepare:cosmoshub": "mustache config/cosmoshub.json subgraph.template.yaml > subgraph.yaml",
1919
"prepare:osmosis": "mustache config/osmosis.json subgraph.template.yaml > subgraph.yaml",

examples/ethereum-basic-event-handlers/test/handlers.js renamed to examples/ethereum-basic-event-handlers/test/handlers.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
const path = require('node:path');
2-
const { system, patching, filesystem } = require('gluegun');
3-
const { createApolloFetch } = require('apollo-fetch');
4-
const { ethers } = require('hardhat');
5-
const { expect } = require('chai');
1+
import path from 'node:path';
2+
import { createApolloFetch } from 'apollo-fetch';
3+
import { expect } from 'chai';
4+
import { filesystem, patching, system } from 'gluegun';
5+
import { ethers } from 'hardhat';
66

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

@@ -56,7 +56,7 @@ describe('Basic event handlers', () => {
5656
await patching.replace(
5757
path.join(srcDir, 'subgraph.yaml'),
5858
'DEPLOYED_CONTRACT_ADDRESS',
59-
registry.target,
59+
String(registry.target),
6060
);
6161

6262
await registry.setMythicalGravatar();

examples/ethereum-basic-event-handlers/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"target": "es6",
44
"module": "commonjs",
55
"moduleResolution": "node",
6-
"outDir": "dist"
6+
"outDir": "dist",
7+
"esModuleInterop": true
78
}
89
}

examples/ethereum-gravatar/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
"build": "graph build",
1313
"build:contract": "hardhat compile",
1414
"codegen": "graph codegen",
15-
"create": "graph create example --node https://api.thegraph.com/deploy/",
15+
"create": "graph create example --node https://api.studio.thegraph.com/deploy/",
1616
"create-local": "graph create example --node http://127.0.0.1:8020",
17-
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
17+
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
1818
"deploy-local": "graph deploy example --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020"
1919
},
2020
"devDependencies": {

examples/near-blocks/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"scripts": {
1212
"build": "graph build",
1313
"codegen": "graph codegen",
14-
"create": "graph create example --node https://api.thegraph.com/deploy/",
14+
"create": "graph create example --node https://api.studio.thegraph.com/deploy/",
1515
"create-local": "graph create example --node http://127.0.0.1:8020",
16-
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
16+
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
1717
"deploy-local": "graph deploy example --ipfs http://localhost:5001 --node http://127.0.0.1:8020"
1818
},
1919
"devDependencies": {

examples/near-receipts/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"scripts": {
1212
"build": "graph build",
1313
"codegen": "graph codegen",
14-
"create": "graph create example --node https://api.thegraph.com/deploy/",
14+
"create": "graph create example --node https://api.studio.thegraph.com/deploy/",
1515
"create-local": "graph create example --node http://127.0.0.1:8020",
16-
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
16+
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
1717
"deploy-local": "graph deploy example --ipfs http://localhost:5001 --node http://127.0.0.1:8020"
1818
},
1919
"devDependencies": {

0 commit comments

Comments
 (0)