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

Integrate Nibiru Chain with subgraph support via SubQuery or TheGraph #2066

Open
7 tasks
Unique-Divine opened this issue Oct 8, 2024 · 1 comment
Open
7 tasks
Labels
ecosytem-tools Tooling or infrastructure with clear demand from applications or end users of Nibiru S-triage Status: This issue is waiting on initial triage. More Info: https://tinyurl.com/25uty9w5

Comments

@Unique-Divine
Copy link
Member

Unique-Divine commented Oct 8, 2024

Purpose

Use a subgraph provider to enable developers to index Nibiru data on the EVM and
create their own subgraphs. This depends on the Ethereum JSON-RPC interface that
Nibiru implements.

2024-10-31-subquery-nibiru-video.mp4

Activity Log and Task List

SubQuery Resources


Background Context

Initially, when this GitHub issue was created, we were evaluating the tradeoffs
between SubQuery and TheGraph:

As an EVM-compatible chain implementing the Ethereum JSON-RPC, Nibiru is a
good candidate for integration with The
Graph
.
We should look into the tradeoffs with SubQuery versus TheGraph to iron out
next steps. A small spike for both integrations would be informative here.

Note that we decided to use SubQuery. I'll leave the notes for the integration
with the TheGraph here for later reference.

[Scope / Tasks for The Graph]
  • Verify Nibiru's JSON-RPC implementation supports required methods:

    • eth_getLogs
    • eth_call (for historical blocks, with EIP-1898)
    • eth_getBlockByNumber
    • eth_getBlockByHash
    • net_version
    • eth_getTransactionReceipt (in batch requests)
    • trace_filter (optional, for call handlers)
  • Reach out to The Graph team to discuss official support and potential inclusion in their documentation. Our team is already connected on Telegram, so we can contact them pretty easily.

  • Set up a local Graph Node environment:

    • Clone the Graph Node repository
    • Modify docker-compose.yml to include Nibiru's network name and JSON-RPC URL
    • Ensure an IPFS node is running or use The Graph's public node
  • Create and deploy a test subgraph:

    • Install graph-cli
    • Create a simple example subgraph (e.g., using Gravitar or Hardhat with Graph plugin)
    • Adapt subgraph.yaml to use Nibiru's network name
    • Deploy the subgraph to the local Graph Node
  • Verify indexing and querying:

    • Monitor Graph Node logs for successful syncing
    • Test GraphQL queries against the deployed subgraph
  • Document the integration process and any Nibiru-specific considerations

Other Notes on TheGraph integration

Note: While a Firehose integration offers performance benefits, it's not required for EVM chains. We can start with the JSON-RPC integration and consider Firehose as a future enhancement.

@Unique-Divine Unique-Divine added the ecosytem-tools Tooling or infrastructure with clear demand from applications or end users of Nibiru label Oct 8, 2024
@github-project-automation github-project-automation bot moved this to ⚡ Building 🧱 in ⚛️ Nibiru (Hougyoku) Oct 8, 2024
@Unique-Divine Unique-Divine changed the title Integrate Nibiru Chain with TheGraph for subgraph support Integrate Nibiru Chain with subgraph support via SubQuery or TheGraph Oct 9, 2024
@Unique-Divine
Copy link
Member Author

Unique-Divine commented Oct 10, 2024

@Unique-Divine Unique-Divine added the S-triage Status: This issue is waiting on initial triage. More Info: https://tinyurl.com/25uty9w5 label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ecosytem-tools Tooling or infrastructure with clear demand from applications or end users of Nibiru S-triage Status: This issue is waiting on initial triage. More Info: https://tinyurl.com/25uty9w5
Projects
Status: ⚡ Building 🧱
Development

No branches or pull requests

1 participant