diff --git a/.changeset/ninety-balloons-stare.md b/.changeset/ninety-balloons-stare.md new file mode 100644 index 000000000..621eac424 --- /dev/null +++ b/.changeset/ninety-balloons-stare.md @@ -0,0 +1,5 @@ +--- +'@graphprotocol/graph-cli': patch +--- + +remove ipfs check for studio deploys diff --git a/.changeset/real-eggs-teach.md b/.changeset/real-eggs-teach.md new file mode 100644 index 000000000..a9b5e34cf --- /dev/null +++ b/.changeset/real-eggs-teach.md @@ -0,0 +1,5 @@ +--- +'@graphprotocol/graph-cli': minor +--- + +Part of the Hosted Service migration throw an error when users are trying to use `hosted-service` product in `graph [auth|deploy|init]` commands. diff --git a/packages/cli/src/command-helpers/compiler.ts b/packages/cli/src/command-helpers/compiler.ts index 297f06427..d335a1f90 100644 --- a/packages/cli/src/command-helpers/compiler.ts +++ b/packages/cli/src/command-helpers/compiler.ts @@ -11,6 +11,7 @@ interface CreateCompilerOptions { outputDir: string; outputFormat: string; skipMigrations: boolean; + // TODO: Remove this is unused blockIpfsMethods?: RegExpMatchArray; protocol: Protocol; } diff --git a/packages/cli/src/commands/auth.ts b/packages/cli/src/commands/auth.ts index c677f8517..ce3b028d4 100644 --- a/packages/cli/src/commands/auth.ts +++ b/packages/cli/src/commands/auth.ts @@ -57,6 +57,9 @@ export default class AuthCommand extends Command { required: true, })); + // Poor var naming will cleanup later + ({ node } = chooseNodeUrl({ product: node, studio: false })); + // eslint-disable-next-line -- prettier has problems with ||= deployKey = deployKey || @@ -68,6 +71,10 @@ export default class AuthCommand extends Command { this.error('✖ Deploy key must not exceed 200 characters', { exit: 1 }); } + if (product === 'hosted-service' || node?.match(/api.thegraph.com/)) { + this.error('✖ The hosted service is deprecated', { exit: 1 }); + } + try { await saveDeployKey(node!, deployKey); print.success(`Deploy key set for ${node}`); diff --git a/packages/cli/src/commands/deploy.ts b/packages/cli/src/commands/deploy.ts index c538eecc3..00a9ab2e8 100644 --- a/packages/cli/src/commands/deploy.ts +++ b/packages/cli/src/commands/deploy.ts @@ -281,6 +281,10 @@ export default class DeployCommand extends Command { ]) .then(({ product }) => product as string)); + if (product === 'hosted-service') { + this.error('✖ The hosted service is deprecated', { exit: 1 }); + } + const { node } = chooseNodeUrl({ product, studio, @@ -455,7 +459,7 @@ export default class DeployCommand extends Command { outputDir, outputFormat: 'wasm', skipMigrations, - blockIpfsMethods: isStudio || undefined, // Network does not support publishing subgraphs with IPFS methods + blockIpfsMethods: undefined, protocol, }); diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index d9966eb4e..2712d78db 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -201,6 +201,11 @@ export default class InitCommand extends Command { } = flags; initDebugger('Flags: %O', flags); + + if (product === 'hosted-service') { + this.error('✖ The hosted service is deprecated', { exit: 1 }); + } + let { node, allowSimpleName } = chooseNodeUrl({ product, // if we are loading example, we want to ensure we are using studio @@ -595,6 +600,10 @@ async function processInitForm( }, ]); + if (product == 'hosted-service') { + this.error('✖ The hosted service is deprecated', { exit: 1 }); + } + const { subgraphName } = await prompt.ask<{ subgraphName: string }>([ { type: 'input', diff --git a/packages/cli/tests/cli/init.test.ts b/packages/cli/tests/cli/init.test.ts index 8218ab1fb..8f8a9bbfc 100644 --- a/packages/cli/tests/cli/init.test.ts +++ b/packages/cli/tests/cli/init.test.ts @@ -201,8 +201,7 @@ describe.sequential( '--skip-git', '--protocol', 'near', - '--product', - 'hosted-service', + '--studio', '--from-contract', 'app.good-morning.near', '--network',