Skip to content

Commit

Permalink
Merge remote-tracking branch 'BenBarahona/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
BenBarahona committed Dec 12, 2024
2 parents 8941804 + e087db8 commit ad279bb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
28 changes: 25 additions & 3 deletions apps/website/versioned_docs/version-v2.x/guides/subgraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:

Expand All @@ -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.
:::
4 changes: 1 addition & 3 deletions packages/contracts/tasks/deploy/poll/01-poll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ deployment.deployTask(EDeploySteps.Poll, "Deploy poll").then((task) =>
intStateTreeDepth,
voteOptionTreeDepth,
},
{
messageBatchSize,
},
messageBatchSize,
unserializedKey.asContractParam(),
extContracts,
emptyBallotRoot.toString(),
Expand Down

0 comments on commit ad279bb

Please sign in to comment.