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

chore: migrate Mantle to 0xGraph #101

Merged
merged 1 commit into from
Sep 11, 2024
Merged

chore: migrate Mantle to 0xGraph #101

merged 1 commit into from
Sep 11, 2024

Conversation

MantisClone
Copy link
Member

@MantisClone MantisClone commented Sep 7, 2024

Resolves #90

Please approve as-is because this was the state of the Repo when I deployed. I'll clean up the mantle stuff in a future PR.

Changes

  • Upgrade @graphprotocol/graph-cli to 0.81.0
  • Fix mantle.subgraph.yaml to use mantle network name
  • Hack the mantle config in cli/graph-nodes.ts and the create-mantle script in package.json. These hacks were ultimately unused. Deployed manually instead.

Summary by CodeRabbit

  • New Features

    • Updated deployment and IPFS endpoints for the Mantle network to enhance service reliability.
    • Shifted Ethereum contract data sources from the mainnet to the Mantle network for improved performance and scalability.
  • Bug Fixes

    • Upgraded the Graph CLI dependency to leverage new features and improvements.

These changes aim to optimize the deployment process and enhance user experience in managing subgraphs.

Copy link

coderabbitai bot commented Sep 7, 2024

Walkthrough

The changes involve updates to the configuration of the mantle network across multiple files. The graphNodeInfoByNetwork constant in cli/graph-nodes.ts has new endpoint URLs. The package.json file reflects a modified deployment command and an upgraded dependency version. Additionally, the subgraph.mantle.yaml file has changed the network designation for several Ethereum contract data sources from "mainnet" to "mantle."

Changes

File Change Summary
cli/graph-nodes.ts Updated deploy and ipfs endpoint URLs for mantle network configuration.
package.json Modified create-mantle command with new deployment URL and upgraded @graphprotocol/graph-cli dependency.
subgraph.mantle.yaml Changed network designation from "mainnet" to "mantle" for several Ethereum contract data sources.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@MantisClone
Copy link
Member Author

MantisClone commented Sep 7, 2024

I deployed the Mantle Payments Subgraph to 0xGraph in commit 1359c4b using the manual deployment instructions listed below:

  1. Authenticate (using deploy key shown in 0xGraph UI)
    graph auth https://subgraph-api.mantle.xyz/deploy
    
  2. Deploy
    mantisclone@mantisclone-Inspiron-7620:~/projects/payments-subgraph$ graph deploy requestnetwork/request-payments-mantle --node https://subgraph-api.mantle.xyz/deploy --ipfs https://subgraph-api.mantle.xyz/ipfs ./subgraph.mantle.yaml
    Which version label to use? (e.g. "v0.0.1"): v0.1.0
      Skip migration: Bump mapping apiVersion from 0.0.1 to 0.0.2
      Skip migration: Bump mapping apiVersion from 0.0.2 to 0.0.3
      Skip migration: Bump mapping apiVersion from 0.0.3 to 0.0.4
      Skip migration: Bump mapping apiVersion from 0.0.4 to 0.0.5
      Skip migration: Bump mapping apiVersion from 0.0.5 to 0.0.6
      Skip migration: Bump manifest specVersion from 0.0.1 to 0.0.2
      Skip migration: Bump manifest specVersion from 0.0.2 to 0.0.4
    ✔ Apply migrations
    ✔ Load subgraph from subgraph.mantle.yaml
      Compile data source: ERC20Proxy => build/ERC20Proxy/ERC20Proxy.wasm
      Compile data source: ERC20FeeProxy_0_2_0 => build/ERC20FeeProxy_0_2_0/ERC20FeeProxy_0_2_0.wasm
      Compile data source: EthProxy_0_3_0 => build/EthProxy_0_3_0/EthProxy_0_3_0.wasm
      Compile data source: EthFeeProxy_0_2_0 => build/EthFeeProxy_0_2_0/EthFeeProxy_0_2_0.wasm
    ✔ Compile subgraph
      Copy schema file build/schema.graphql
      Write subgraph file build/ERC20Proxy/abis/ERC20Proxy.json
      Write subgraph file build/ERC20FeeProxy_0_2_0/abis/ERC20FeeProxy-0.2.0.json
      Write subgraph file build/EthProxy_0_3_0/abis/EthProxy-0.3.0.json
      Write subgraph file build/EthFeeProxy_0_2_0/abis/EthFeeProxy-0.2.0.json
      Write subgraph manifest build/subgraph.yaml
    ✔ Write compiled subgraph to build/
      Add file to IPFS build/schema.graphql
                    .. QmSKCwC9hhfezuk9UdfCVk6Bqxgi8PXt4h8MQC14UGK446
      Add file to IPFS build/ERC20Proxy/abis/ERC20Proxy.json
                    .. QmUXm6CtZHNtUoNS6hxLefAV1h2ythN4f3N7GUWPgQctV2
      Add file to IPFS build/ERC20FeeProxy_0_2_0/abis/ERC20FeeProxy-0.2.0.json
                    .. QmRdM2xXFCi6h9PwRsmBHCPupc2MbsiDfg1wkXjZxvcxTD
      Add file to IPFS build/EthProxy_0_3_0/abis/EthProxy-0.3.0.json
                    .. QmWyBM7Yh78mBr1VGCsHkHGfChG5JgeZHtHQzV6ZCRgkg6
      Add file to IPFS build/EthFeeProxy_0_2_0/abis/EthFeeProxy-0.2.0.json
                    .. QmSsyL9o9ggK2S7KcPXvNjkogBLsXzik3axgsXAx9SjSbJ
      Add file to IPFS build/ERC20Proxy/ERC20Proxy.wasm
                    .. QmVpEcwGhh1BTgU2sDJUZAbdM8wmsHwXkDffFShKmLF7bn
      Add file to IPFS build/ERC20FeeProxy_0_2_0/ERC20FeeProxy_0_2_0.wasm
                    .. Qmck5KM2S6SFAzuvxj5D1CZ7Yspx8JLNHuwXZksubeqH2P
      Add file to IPFS build/EthProxy_0_3_0/EthProxy_0_3_0.wasm
                    .. QmT2wr8Jy6CdKfCbjcDJecG6hys39Kp69NyQ3zVuDdD5yh
      Add file to IPFS build/EthFeeProxy_0_2_0/EthFeeProxy_0_2_0.wasm
                    .. QmXu7ie2mXPQmQZkW6wgNtYBPrWkG412Agmufh9AxmtDsy
    ✔ Upload subgraph to IPFS
    
    Build completed: QmfZ1KQXzpj3VgKv9qFEjXJEyiJzV6EtxFeWYLaM34sHQ5
    
    Deployed to <omitted for privacy>
    
    Subgraph endpoints:
    Queries (HTTP):     <omitted for privacy>
    

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between ee0176d and 1359c4b.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (3)
  • cli/graph-nodes.ts (1 hunks)
  • package.json (1 hunks)
  • subgraph.mantle.yaml (5 hunks)
Additional comments not posted (8)
cli/graph-nodes.ts (2)

28-28: Endpoint URL Updated Correctly

The change to the deploy endpoint URL for the mantle network appears correct and aligns with the new service provider's URL structure. Ensure to verify the availability and functionality of the new endpoint.

Run the following script to verify the endpoint's availability:

Verification successful

Endpoint URL Verified Successfully

The deploy endpoint URL for the mantle network is reachable and responding with a 200 status code, confirming its availability and correctness. No further action is required.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the new deploy endpoint is reachable.

curl -o /dev/null -s -w "%{http_code}\n" https://subgraph-api.mantle.xyz/deploy

Length of output: 85


30-30: IPFS Endpoint URL Updated Correctly

The change to the ipfs endpoint URL for the mantle network appears correct and aligns with the new service provider's URL structure. Ensure to verify the functionality of the new IPFS endpoint.

Run the following script to verify the IPFS endpoint's functionality:

package.json (2)

15-15: Deployment Command Updated Correctly

The update to the create-mantle command in the scripts section appears correct and aligns with the new service provider's URL structure. Ensure to verify the functionality of the new command.

Run the following script to verify the command's functionality:


23-23: Dependency Version Updated Correctly

The update to the @graphprotocol/graph-cli dependency version appears correct. Ensure to verify the compatibility of the new version with the project's existing configuration and functionality.

Run the following script to verify the dependency's compatibility:

subgraph.mantle.yaml (4)

7-7: Network Designation Updated Correctly

The change to the network field for the ERC20Proxy data source appears correct and aligns with the strategic pivot towards utilizing the Mantle network. Ensure to verify the functionality of the new network designation.

Run the following script to verify the network's functionality:

Verification successful

Network Designation Verified

The change to the network field for the ERC20Proxy data source to mantle is correct and supported by the codebase. The Mantle network is referenced in multiple configuration and documentation files, indicating it is a recognized and operational network within the project. No further action is required.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the new network designation is functional.

yarn deploy-local

Length of output: 91


Script:

#!/bin/bash
# Search for references to 'mantle' in the codebase to verify its usage and configuration.
rg 'mantle' -A 5

# Search for any configuration or setup scripts that might involve the 'mantle' network.
ast-grep --lang yaml --pattern 'network: mantle'

Length of output: 6422


49-49: Network Designation Updated Correctly

The change to the network field for the EthProxy_0_3_0 data source appears correct and aligns with the strategic pivot towards utilizing the Mantle network. Ensure to verify the functionality of the new network designation.

Run the following script to verify the network's functionality:

Verification successful

Network Change to Mantle is Well-Integrated

The change to the network field for the EthProxy_0_3_0 data source to mantle is consistent with the project's configuration and documentation. The mantle network is well-represented across various files, indicating a deliberate and supported integration. Ensure to verify the deployment process in an environment where the necessary tools are available.

  • Files with Mantle References:
    • subgraph.mantle.yaml
    • package.json
    • cli/networks.json
    • README.md
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the new network designation is functional.

yarn deploy-local

Length of output: 91


Script:

#!/bin/bash
# Search for occurrences of 'mantle' in the codebase to find related configurations or documentation.
rg 'mantle' -A 5

Length of output: 6262


70-70: Network Designation Updated Correctly

The change to the network field for the EthFeeProxy_0_2_0 data source appears correct and aligns with the strategic pivot towards utilizing the Mantle network. Ensure to verify the functionality of the new network designation.

Run the following script to verify the network's functionality:

Verification successful

Network Designation Updated Correctly

The change to the network field for the EthFeeProxy_0_2_0 data source to mantle is well-supported by the codebase. The Mantle network is comprehensively configured across multiple files, including deployment scripts and network endpoints. Ensure to verify the functionality of the new network designation in a suitable environment.

  • Files with Mantle Configuration:
    • subgraph.mantle.yaml
    • package.json
    • cli/networks.json
    • cli/graph-nodes.ts
    • README.md
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the new network designation is functional.

yarn deploy-local

Length of output: 91


Script:

#!/bin/bash
# Search for references to the 'mantle' network in the codebase to verify its configuration and usage.
rg 'mantle' -A 5

Length of output: 6262


28-28: Network Designation Updated Correctly

The change to the network field for the ERC20FeeProxy_0_2_0 data source appears correct and aligns with the strategic pivot towards utilizing the Mantle network. Ensure to verify the functionality of the new network designation.

Run the following script to verify the network's functionality:

Verification successful

Network Designation to Mantle Verified

The change to the network field for the ERC20FeeProxy_0_2_0 data source to mantle is correctly configured and integrated within the codebase. The Mantle network is referenced in multiple configuration files, scripts, and documentation, indicating proper setup and usage. No further action is required.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the new network designation is functional.

yarn deploy-local

Length of output: 91


Script:

#!/bin/bash
# Search for references to the 'mantle' network in the codebase to verify its configuration and usage.
rg 'mantle' --context 5

Length of output: 9467

@MantisClone MantisClone changed the title chore: migrate Mantle to 0xGraph chore: migrate Mantle to 0xGraph, automate deployment Sep 8, 2024
@MantisClone MantisClone marked this pull request as draft September 11, 2024 16:11
@MantisClone MantisClone changed the title chore: migrate Mantle to 0xGraph, automate deployment chore: migrate Mantle to 0xGraph Sep 11, 2024
@MantisClone MantisClone marked this pull request as ready for review September 11, 2024 16:17
@MantisClone MantisClone self-assigned this Sep 11, 2024
Copy link

@rodrigopavezi rodrigopavezi left a comment

Choose a reason for hiding this comment

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

looks good 👍

@MantisClone MantisClone merged commit 10699be into main Sep 11, 2024
1 check passed
@MantisClone MantisClone deleted the deploy-mantle branch September 11, 2024 20:40
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.

Migrate Mantle Payment Subgraph to 0xGraph
2 participants