Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(subgraph): add subgraph module for indexing data #1203

Merged

Conversation

hangleang
Copy link

Description

Add subgraph module and integrate into the workspace with the following functionality:

  • support multiple network's deployment
  • automate saved deployment into networks.json file for generating subgraph.yaml
  • index all Poll related events, which has been deployed from the MACI contract instance

Additional Notes

every deployment of MACI contracts will be automatically updated the networks.json file, but you need to manually generate the subgraph.yaml by running pnpm run codegen:local in the subgraph directory

There is also some limitation of current implementation including:

  • missing some properties to serve as complete data layer for MACI due to only indexing the events, not yet include the call function's handler
  • missing test scripts

All of those will be improved later on while review the PR

Related issue(s)

Not related to any issue

Confirmation

Copy link

netlify bot commented Feb 18, 2024

Deploy Preview for maci-typedoc ready!

Name Link
🔨 Latest commit ed12ff8
🔍 Latest deploy log https://app.netlify.com/sites/maci-typedoc/deploys/65f973be6e8c3e000868b737
😎 Deploy Preview https://deploy-preview-1203--maci-typedoc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@0xmad 0xmad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hangleang thanks, take a look at the maci-contracts package and you can reuse eslint config and tsconfig from there. Left some comments to fix.

.eslintignore Outdated Show resolved Hide resolved
cli/testScript.sh Outdated Show resolved Hide resolved
.eslintignore Outdated Show resolved Hide resolved
cli/ts/utils/constants.ts Outdated Show resolved Hide resolved
cli/ts/utils/storage.ts Outdated Show resolved Hide resolved
subgraph/src/utils/helper.ts Outdated Show resolved Hide resolved
subgraph/subgraph.template.yaml Outdated Show resolved Hide resolved
subgraph/subgraph.template.yaml Outdated Show resolved Hide resolved
subgraph/subgraph.template.yaml Outdated Show resolved Hide resolved
tsconfig.json Outdated Show resolved Hide resolved
subgraph/schema.graphql Outdated Show resolved Hide resolved
subgraph/.eslintrc.js Outdated Show resolved Hide resolved
@hangleang
Copy link
Author

UPDATED

We no longer need to manually generate the subgraph.yaml file with pnpm run codegen:local command, which is also be removed from the script. it will automatically generate the file before deploying to the graph with specificed --network flag

.prettierignore Outdated Show resolved Hide resolved
Copy link

vercel bot commented Mar 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
maci-website ✅ Ready (Inspect) Visit Preview Jun 6, 2024 10:33pm

Copy link
Collaborator

@0xmad 0xmad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hangleang thanks, can you squash your commits to fix commitlint check and describe in commit message general work done for this task?

hangleang and others added 12 commits June 4, 2024 22:30
Update subgraph/src/poll.ts

Co-authored-by: Anton <14254374+0xmad@users.noreply.github.com>

Update subgraph/src/poll.ts

Co-authored-by: Anton <14254374+0xmad@users.noreply.github.com>

Update subgraph/src/maci.ts

Co-authored-by: Anton <14254374+0xmad@users.noreply.github.com>

Update subgraph/src/poll.ts

Co-authored-by: Anton <14254374+0xmad@users.noreply.github.com>
@ctrlc03 ctrlc03 changed the base branch from dev to feat/subgraph-pr June 6, 2024 22:28
@ctrlc03 ctrlc03 merged commit dac31dc into privacy-scaling-explorations:feat/subgraph-pr Jun 7, 2024
17 of 19 checks passed
Copy link

gitpoap-bot bot commented Jun 7, 2024

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

GitPOAP: 2024 MACI Contributor:

GitPOAP: 2024 MACI Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants