diff --git a/apps/website/versioned_docs/version-v2.x/guides/subgraph.md b/apps/website/versioned_docs/version-v2.x/guides/subgraph.md index 35281743c8..863457c36e 100644 --- a/apps/website/versioned_docs/version-v2.x/guides/subgraph.md +++ b/apps/website/versioned_docs/version-v2.x/guides/subgraph.md @@ -7,10 +7,10 @@ sidebar_position: 1 # Subgraph Deployment -In some instances like a frontend you might need to deploy a subgraph, in the MACI repository you can find the configuration to deploy a subgraph on The Graph Network. +In some instances like a frontend you might need to deploy a subgraph, in the MACI repository you can find the configuration to deploy a subgraph on The Graph Network or Alchemy Subgraphs. :::important -MACI subgraphs can be deployed in Alchemy and The Graph network, this guide focuses on deploying on The Graph. +While the free plan of The Graph and Alchemy can work well, it's recommended to use a paid plan for production. ::: ## Configuration @@ -37,7 +37,7 @@ See the supported networks of The Graph **[here](https://thegraph.com/docs/en/de Create a subgraph in [the graph studio](https://thegraph.com/studio/) and name it `maci-subgraph`. -## Deployment +## The Graph Deployment The first thing you need to do is to copy the `key` in subgraph studio dashboard and run the following command to authenticate: @@ -55,3 +55,25 @@ pnpm run deploy :::important The `pnpm run deploy` command uses `maci-subgraph` as the subgraph name by default, but if you named your subgraph differently (e.g. maci-graph, my-graph, etc.), please change the command to `graph deploy --node https://api.studio.thegraph.com/deploy/ your_subgraph_name` ::: + +## Alchemy Deployment + +Deploying to the Alchemy subgraph service requires some changes to the `subgraph.template.yaml` file located in the `templates` folder. You need to remove the following keys: + +```yaml +indexerHints: + prune: auto +``` + +Now you can run the deploy command with some minor changes: + +```bash +graph deploy SUBGRAPH_NAME \ + --version-label VERSION \ + --node https://subgraphs.alchemy.com/api/subgraphs/deploy \ + --deploy-key API_KEY +``` + +:::note +In order to get a subgraph deploy key for alchemy, head to the subgraph dashboard section and select `add subgraph` and pick `Deploy a New Subgraph` here you will see the deploy key. +::: diff --git a/packages/contracts/tasks/deploy/poll/01-poll.ts b/packages/contracts/tasks/deploy/poll/01-poll.ts index 905e4a6b48..4a6459019a 100644 --- a/packages/contracts/tasks/deploy/poll/01-poll.ts +++ b/packages/contracts/tasks/deploy/poll/01-poll.ts @@ -100,9 +100,7 @@ deployment.deployTask(EDeploySteps.Poll, "Deploy poll").then((task) => intStateTreeDepth, voteOptionTreeDepth, }, - { - messageBatchSize, - }, + messageBatchSize, unserializedKey.asContractParam(), extContracts, emptyBallotRoot.toString(),