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

Adding a unified narrative doc for data access interfaces #21078

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

abhinavg6
Copy link

Description

Adding a new high-level document for the unified narrative of Sui data access interfaces, including both current and forward looking ones - GraphQL and gRPC.

Test plan

This is just a document addition to clarify the available data access interfaces.


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

Copy link

vercel bot commented Feb 3, 2025

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

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 4, 2025 10:30pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Feb 4, 2025 10:30pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Feb 4, 2025 10:30pm

@github-actions github-actions bot added the Type: Documentation Improvements or additions to documentation label Feb 3, 2025
@abhinavg6 abhinavg6 marked this pull request as ready for review February 3, 2025 22:52
@abhinavg6 abhinavg6 marked this pull request as draft February 3, 2025 22:52
@abhinavg6
Copy link
Author

cc @amnn @bmwill - Can I request you to please review and let me know of any edits? Once it has your blessings, I'll request Ronny's review.


You can use either of the following mechanisms to access Sui network data currently:

- Directly connect to [JSON-RPC](/references/sui-api.mdx) hosted by a Sui [full node](guides/operator/sui-full-node.mdx) where the [Mainnet](https://fullnode.mainnet.sui.io:443) or [Testnet](https://fullnode.testnet.sui.io:443) or [Devnet](https://fullnode.devnet.sui.io:443) load balancer URLs abstract a few globally distributed full nodes, OR
Copy link
Contributor

Choose a reason for hiding this comment

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

Seeing fullnode written full node always seems to bother me, even though i know full node is likely more grammatically correct. In code its always written as fullnode but 🤷🏼‍♂️


### Custom indexer

If you need object version history or another type of historical data where you may not fully rely on a full node or RPC provider, or if you've specific query patterns that could be best served from a relational database, then you can setup your own [custom indexer](/guides/developer/advanced/custom-indexer.mdx) or reach out to a [Data indexer operator](https://github.com/sui-foundation/awesome-sui?tab=readme-ov-file#indexers--data-services) who may already have setup one.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If you need object version history or another type of historical data where you may not fully rely on a full node or RPC provider, or if you've specific query patterns that could be best served from a relational database, then you can setup your own [custom indexer](/guides/developer/advanced/custom-indexer.mdx) or reach out to a [Data indexer operator](https://github.com/sui-foundation/awesome-sui?tab=readme-ov-file#indexers--data-services) who may already have setup one.
If you need object version history or another type of historical data where you may not fully rely on a full node or RPC provider, or if you have specific query patterns that could be best served from a relational database, then you can setup your own [custom indexer](/guides/developer/advanced/custom-indexer.mdx) or reach out to a [Data indexer operator](https://github.com/sui-foundation/awesome-sui?tab=readme-ov-file#indexers--data-services) who may already have setup one.

nit but "you have" seems to read better/clearer to me than the contraction form

Primary interfaces to access Sui access data in future will be:

- Full node gRPC API will replace JSON-RPC on full nodes, and is currently available in alpha. If you already use the JSON-RPC or are starting to utilize it as a dependency for your use case, you would need to migrate to gRPC or GraphQL (see below) within a reasonable duration. Refer to the high-level timeline for gRPC availability [below](#grpc-api).
- [GraphQL RPC with Indexer 2.0](/references/sui-graphql.mdx) will replace the custom indexer mechanism and is currently available in beta. This will be a combination of a performant indexing mechanism that one could use to load and manage data in a postgres relational database, and a lightweight GraphQL RPC server that will be used to read data from that database.
Copy link
Contributor

Choose a reason for hiding this comment

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

will replace the custom indexer mechanism and is currently available in beta

IIUC this isn't quite accurate. We want to continue supporting folks writing their own custom indexers or custom data processors utilizing the indexing framework. Graphql is one such product that leverages the indexing framework


As mentioned above, gRPC API will replace the JSON-RPC on full nodes, such that JSON-RPC will be deprecated when gRPC API is generally available. Apart from the message & request format changes between the two, the gRPC API will come with a couple of key functional differences:

- It will have streaming or subscription API endpoints such that you could consume real-time streaming data in your application without having to poll for those records. This support will be a proper replacement of the deprecated Webdockets support in JSON-RPC.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- It will have streaming or subscription API endpoints such that you could consume real-time streaming data in your application without having to poll for those records. This support will be a proper replacement of the deprecated Webdockets support in JSON-RPC.
- It will have streaming or subscription API endpoints such that you could consume real-time streaming data in your application without having to poll for those records. This support will be a proper replacement of the deprecated Websocket support in JSON-RPC.

As mentioned above, gRPC API will replace the JSON-RPC on full nodes, such that JSON-RPC will be deprecated when gRPC API is generally available. Apart from the message & request format changes between the two, the gRPC API will come with a couple of key functional differences:

- It will have streaming or subscription API endpoints such that you could consume real-time streaming data in your application without having to poll for those records. This support will be a proper replacement of the deprecated Webdockets support in JSON-RPC.
- It will not have a implicit fallback on the above mentioned [Mysten Labs managed key-value store for historical transaction data](/guides/operator/data-management.mdx#sui-full-node-key-value-store-backup). You would have an option to configure that dependency explicitly though, while other full-node operators or RPC providers will also be encouraged to run their own instance of the key-value store.
Copy link
Contributor

Choose a reason for hiding this comment

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

You would have an option to configure that dependency explicitly though, while other full-node operators or RPC providers will also be encouraged to run their own instance of the key-value store.

I still am opposed to this and i think we shouldn't make this functionality promise yet. I think having a proper archival service that clients can explicitly call would be a much more preferable alternative.

Copy link
Contributor

@amnn amnn 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 to me! Mostly adding comments based on the discussion in our meeting just now. I haven't looked at the wording or style, which I would leave to @ronny-mysten .

Comment on lines 381 to 382
- [Sui Testnet GraphQL](https://sui-testnet.mystenlabs.com/graphql): Sui GraphQL IDE for the Testnet network.
- [Sui Mainnet GraphQL](https://sui-mainnet.mystenlabs.com/graphql): Sui GraphQL IDE for the Mainnet network.
Copy link
Contributor

Choose a reason for hiding this comment

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

The i was intentional here by the way -- GraphiQL is the name of the IDE.


You can use either of the following mechanisms to access Sui network data currently:

- Directly connect to [JSON-RPC](/references/sui-api.mdx) hosted by a Sui [Full node](guides/operator/sui-full-node.mdx) where the [Mainnet](https://fullnode.mainnet.sui.io:443) or [Testnet](https://fullnode.testnet.sui.io:443) or [Devnet](https://fullnode.devnet.sui.io:443) load balancer URLs abstract Mysten Labs managed Full nodes, OR
Copy link
Contributor

Choose a reason for hiding this comment

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

We talked about clarifying that these are offered by Sui Foundation, and also the fact that these endpoints are not intended for production use.

You can use either of the following mechanisms to access Sui network data currently:

- Directly connect to [JSON-RPC](/references/sui-api.mdx) hosted by a Sui [Full node](guides/operator/sui-full-node.mdx) where the [Mainnet](https://fullnode.mainnet.sui.io:443) or [Testnet](https://fullnode.testnet.sui.io:443) or [Devnet](https://fullnode.devnet.sui.io:443) load balancer URLs abstract Mysten Labs managed Full nodes, OR
- Set up your own [custom indexer](/guides/developer/advanced/custom-indexer.mdx) to continuously load the data of interest in a Postgres database, OR
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that we will need to update the custom indexing docs as well.


- Directly connect to [JSON-RPC](/references/sui-api.mdx) hosted by a Sui [Full node](guides/operator/sui-full-node.mdx) where the [Mainnet](https://fullnode.mainnet.sui.io:443) or [Testnet](https://fullnode.testnet.sui.io:443) or [Devnet](https://fullnode.devnet.sui.io:443) load balancer URLs abstract Mysten Labs managed Full nodes, OR
- Set up your own [custom indexer](/guides/developer/advanced/custom-indexer.mdx) to continuously load the data of interest in a Postgres database, OR
- Utilize a [RPC provider](https://sui.io/developers#dev-tools) (filter by `RPC`) or [Data indexer operator](https://github.com/sui-foundation/awesome-sui?tab=readme-ov-file#indexers--data-services) who have setup their own Full nodes or indexing infrastructure.
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice if we could link directly to a particular tab in the dev tools -- I have also found myself having to add the little addendum (like "filter by RPC") when sending this advice to others.


:::info

You can use one of the [future-oriented interfaces]((#future-state-data-interfaces)) that are available in alpha or beta, but you must validate the relevant functionality, performance, and cost characteristics for your application before deciding to use those in production.
Copy link
Contributor

Choose a reason for hiding this comment

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

Given our discussion, let's clarify what we mean by alpha and beta.


### gRPC API

As mentioned above, gRPC API will replace the JSON-RPC on Full nodes, such that JSON-RPC will be deprecated when gRPC API is generally available. Apart from the message & request format changes between the two, the gRPC API will come with a couple of key functional differences:
Copy link
Contributor

Choose a reason for hiding this comment

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

The functionality that we currently offer in JSON-RPC will end up split between gRPC and GraphQL (the archival/historical object access is a good example of this), this is slightly different from the fact that after all is said and down, fullnodes will only speak gRPC.

Copy link
Author

Choose a reason for hiding this comment

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

I've already mentioned something related to that in the second point below. Beyond that I think we should figure out a proper historical data access architecture before being specific here.

| -------- | ------- | ------- |
| March 2025 | Beta release of the initial set of polling-based APIs | You can start validating the initial gRPC integration from your applications and share feedback on the improvements you would like to see. |
| May 2025 | Beta release of the streaming APIs and the remaining set of polling-based APIs | If your use case requires streaming low-latency data, this would be apt time to start validating that integration. Also, the API coverage will be functionality wise complete at this point, so you can start migrating your application in the non-production environments. |
| July 2025 | GA release of the polling-based APIs with appropriate SDK support | You can start migration and cutover of your application in the production environment, with the support for streaming APIs still in beta. **JSON-RPC will be deprecated at this point and migration notice period will start.** |
Copy link
Contributor

Choose a reason for hiding this comment

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

Talked about pushing the JSON-RPC deprecation timeline by 3 months.


:::info

GraphQL with Indexer 2.0 is in beta and its recommended that you thoroughly investigate its functional, performance and cost properties before using it in production. Check out [this getting started document](guides/developer/getting-started/graphql-rpc.mdx) that refers to Mysten Labs managed relevant infrastructure.
Copy link
Contributor

Choose a reason for hiding this comment

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

Talked about describing GraphQL as being in alpha instead of beta.

| **Dimension** | **gRPC API** | **GraphQL RPC with Indexer 2.0** |
| -------- | ------- | ------- |
| Type of application or data consumer | Ideal for Web3 exchanges, defi market maker apps, other defi protocols or apps with ultra low-latency needs | Ideal for webapp builders or builders with slightly relaxed latency needs |
| Query patterns | Okay to read data from different endpoints separately and combine on the client-side; faster serialization, parsing and validation due to binary format | Need easier docoupling of the client with the ability to combine different types of data in fewer calls |
Copy link
Contributor

Choose a reason for hiding this comment

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

Consistency (or snapshot isolation) is another key differentiator.

| -------- | ------- | ------- |
| Type of application or data consumer | Ideal for Web3 exchanges, defi market maker apps, other defi protocols or apps with ultra low-latency needs | Ideal for webapp builders or builders with slightly relaxed latency needs |
| Query patterns | Okay to read data from different endpoints separately and combine on the client-side; faster serialization, parsing and validation due to binary format | Need easier docoupling of the client with the ability to combine different types of data in fewer calls |
| Retention period requirements | Default retention period will be 2 weeks with actual configuration dependent on the Full node operator and their needs & goals; see history-related note after the table | Default retention period in postgres database will be 4 weeks with actual configuration depending on your or the data indexer operator's needs; see history-related note after the table |
Copy link
Contributor

Choose a reason for hiding this comment

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

For GraphQL, the 4 week retention period applies to queries (like "give me all transactions that called these functions") and not to point look-ups, which will use the archival service and therefore are not pruned. This is maybe another useful differentiator between the services?

Copy link
Author

Choose a reason for hiding this comment

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

I think we should wait to be more specific here until after we've figured out and have alignment on the historical data architecture. IMO, we would need some mechanism for exchanges or defi protocol builders to access historical data when using gRPC, so we need to think through this.

docs/content/concepts/graphql-rpc.mdx Show resolved Hide resolved

Refer to [Access Sui Data](/guides/developer/getting-started/data-serving.mdx) for an overview of options to access Sui network data.

GraphQL RPC was earlier shared to be in beta in 2024. But based on valuable feedback from the community, its release stage has been updated to alpha. You can refer to the updated high-level timeline for beta and GA releases in the above linked document.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
GraphQL RPC was earlier shared to be in beta in 2024. But based on valuable feedback from the community, its release stage has been updated to alpha. You can refer to the updated high-level timeline for beta and GA releases in the above linked document.
Based on valuable feedback from the community, the GraphQL RPC release stage has been updated from beta to alpha. Refer to the high-level timeline for beta and GA releases in the previously linked document.

Typically want to avoid 'above' and 'below' because you can never be certain of rendered location. Here you don't have to really worry about that but just want to remain consistent in wording.

description: Overview of the types of data access mechanisms available in Sui
---

You can access Sui network data like [Transactions](/concepts/transactions.mdx), [Checkpoints](/concepts/cryptography/system/checkpoint-verification.mdx), [Objects](/concepts/object-model.mdx), [Events](/guides/developer/sui-101/using-events.mdx) and more through the available interfaces, in order to use in your application workflows, or to analyze the network behavior across applications or protocols of interest, or to perform audits on parts or whole of the network.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can access Sui network data like [Transactions](/concepts/transactions.mdx), [Checkpoints](/concepts/cryptography/system/checkpoint-verification.mdx), [Objects](/concepts/object-model.mdx), [Events](/guides/developer/sui-101/using-events.mdx) and more through the available interfaces, in order to use in your application workflows, or to analyze the network behavior across applications or protocols of interest, or to perform audits on parts or whole of the network.
You can access Sui network data like [Transactions](/concepts/transactions.mdx), [Checkpoints](/concepts/cryptography/system/checkpoint-verification.mdx), [Objects](/concepts/object-model.mdx), [Events](/guides/developer/sui-101/using-events.mdx), and more through the available interfaces. You can use this data in your application workflows, to analyze the network behavior across applications or protocols of interest, or to perform audits on parts or the whole of the network.

just breaking up long sentence


You can access Sui network data like [Transactions](/concepts/transactions.mdx), [Checkpoints](/concepts/cryptography/system/checkpoint-verification.mdx), [Objects](/concepts/object-model.mdx), [Events](/guides/developer/sui-101/using-events.mdx) and more through the available interfaces, in order to use in your application workflows, or to analyze the network behavior across applications or protocols of interest, or to perform audits on parts or whole of the network.

This document outlines the interfaces that are currently available to access the Sui network data, along with a overview of how that's gradually evolving for a great deveoper experience.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This document outlines the interfaces that are currently available to access the Sui network data, along with a overview of how that's gradually evolving for a great deveoper experience.
This document outlines the interfaces that are currently available to access the Sui network data, along with an overview of how that's gradually evolving.

no subjective points of view in docs, por favor


## Current data access interfaces

You can use either of the following mechanisms to access Sui network data currently:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can use either of the following mechanisms to access Sui network data currently:
Currently, you can use any of the following mechanisms to access Sui network data:


You can use either of the following mechanisms to access Sui network data currently:

- Directly connect to [JSON-RPC](/references/sui-api.mdx) hosted by a Sui [Full node](guides/operator/sui-full-node.mdx) where the [Mainnet](https://fullnode.mainnet.sui.io:443) or [Testnet](https://fullnode.testnet.sui.io:443) or [Devnet](https://fullnode.devnet.sui.io:443) load balancer URLs abstract Mysten Labs managed Full nodes, OR
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Directly connect to [JSON-RPC](/references/sui-api.mdx) hosted by a Sui [Full node](guides/operator/sui-full-node.mdx) where the [Mainnet](https://fullnode.mainnet.sui.io:443) or [Testnet](https://fullnode.testnet.sui.io:443) or [Devnet](https://fullnode.devnet.sui.io:443) load balancer URLs abstract Mysten Labs managed Full nodes, OR
- Directly connect to [JSON-RPC](/references/sui-api.mdx) hosted by a Sui [Full node](guides/operator/sui-full-node.mdx) where the [Mainnet](https://fullnode.mainnet.sui.io:443) or [Testnet](https://fullnode.testnet.sui.io:443) or [Devnet](https://fullnode.devnet.sui.io:443) load balancer URLs abstract Mysten Labs managed Full nodes.

or here is redundant

You can use either of the following mechanisms to access Sui network data currently:

- Directly connect to [JSON-RPC](/references/sui-api.mdx) hosted by a Sui [Full node](guides/operator/sui-full-node.mdx) where the [Mainnet](https://fullnode.mainnet.sui.io:443) or [Testnet](https://fullnode.testnet.sui.io:443) or [Devnet](https://fullnode.devnet.sui.io:443) load balancer URLs abstract Mysten Labs managed Full nodes, OR
- Set up your own [custom indexer](/guides/developer/advanced/custom-indexer.mdx) to continuously load the data of interest in a Postgres database, OR
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Set up your own [custom indexer](/guides/developer/advanced/custom-indexer.mdx) to continuously load the data of interest in a Postgres database, OR
- Set up your own [custom indexer](/guides/developer/advanced/custom-indexer.mdx) to continuously load the data of interest in a Postgres database.


- Directly connect to [JSON-RPC](/references/sui-api.mdx) hosted by a Sui [Full node](guides/operator/sui-full-node.mdx) where the [Mainnet](https://fullnode.mainnet.sui.io:443) or [Testnet](https://fullnode.testnet.sui.io:443) or [Devnet](https://fullnode.devnet.sui.io:443) load balancer URLs abstract Mysten Labs managed Full nodes, OR
- Set up your own [custom indexer](/guides/developer/advanced/custom-indexer.mdx) to continuously load the data of interest in a Postgres database, OR
- Utilize a [RPC provider](https://sui.io/developers#dev-tools) (filter by `RPC`) or [Data indexer operator](https://github.com/sui-foundation/awesome-sui?tab=readme-ov-file#indexers--data-services) who have setup their own Full nodes or indexing infrastructure.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Utilize a [RPC provider](https://sui.io/developers#dev-tools) (filter by `RPC`) or [Data indexer operator](https://github.com/sui-foundation/awesome-sui?tab=readme-ov-file#indexers--data-services) who have setup their own Full nodes or indexing infrastructure.
- Utilize an [RPC provider](https://sui.io/developers#dev-tools) (filter by `RPC`) or [Data indexer operator](https://github.com/sui-foundation/awesome-sui?tab=readme-ov-file#indexers--data-services) who have set up their own Full nodes or indexing infrastructure.


### JSON-RPC

You can currently get real-time or historical data from a Sui Full node. Retention period for historical data depends on the [pruning strategy](/guides/operator/data-management.mdx#sui-full-node-pruning-policies) implemented by a node operator, though currently all Full nodes are by default configured to implicitly fall back on a [Mysten Labs managed key-value store for historical transaction data](/guides/operator/data-management.mdx#sui-full-node-key-value-store-backup).
Copy link
Contributor

Choose a reason for hiding this comment

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

We've typically kept ML name out of the docs. Is it necessary here?


:::caution

Websockets based JSON RPCs `suix_subscribeEvent` and `suix_subscribeTransaction` were deprecated in July 2024. You should not rely on those RPCs in your applications. Refer to [this section](#future-state-data-interfaces) to learn about a future alternative.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Websockets based JSON RPCs `suix_subscribeEvent` and `suix_subscribeTransaction` were deprecated in July 2024. You should not rely on those RPCs in your applications. Refer to [this section](#future-state-data-interfaces) to learn about a future alternative.
Websockets-based JSON RPCs `suix_subscribeEvent` and `suix_subscribeTransaction` were deprecated in July 2024. You should not rely on those RPCs in your applications. Refer to [Future data access interfaces](#future-state-data-interfaces) to learn about a future alternative.

Copy link
Contributor

@stefan-mysten stefan-mysten left a comment

Choose a reason for hiding this comment

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

Some initial thoughts.

description: Overview of the types of data access mechanisms available in Sui
---

You can access Sui network data like [Transactions](/concepts/transactions.mdx), [Checkpoints](/concepts/cryptography/system/checkpoint-verification.mdx), [Objects](/concepts/object-model.mdx), [Events](/guides/developer/sui-101/using-events.mdx) and more through the available interfaces, in order to use in your application workflows, or to analyze the network behavior across applications or protocols of interest, or to perform audits on parts or whole of the network.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can access Sui network data like [Transactions](/concepts/transactions.mdx), [Checkpoints](/concepts/cryptography/system/checkpoint-verification.mdx), [Objects](/concepts/object-model.mdx), [Events](/guides/developer/sui-101/using-events.mdx) and more through the available interfaces, in order to use in your application workflows, or to analyze the network behavior across applications or protocols of interest, or to perform audits on parts or whole of the network.
You can access Sui network data like [Transactions](/concepts/transactions.mdx), [Checkpoints](/concepts/cryptography/system/checkpoint-verification.mdx), [Objects](/concepts/object-model.mdx), [Events](/guides/developer/sui-101/using-events.mdx) and more through the available interfaces explained in this document.
Use this data in your application workflows, to analyze the network behavior across applications or protocols of interest, or to perform audits on parts or whole of the network.


You can access Sui network data like [Transactions](/concepts/transactions.mdx), [Checkpoints](/concepts/cryptography/system/checkpoint-verification.mdx), [Objects](/concepts/object-model.mdx), [Events](/guides/developer/sui-101/using-events.mdx) and more through the available interfaces, in order to use in your application workflows, or to analyze the network behavior across applications or protocols of interest, or to perform audits on parts or whole of the network.

This document outlines the interfaces that are currently available to access the Sui network data, along with a overview of how that's gradually evolving for a great deveoper experience.
Copy link
Contributor

Choose a reason for hiding this comment

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

Move this to the top of the document.

Suggested change
This document outlines the interfaces that are currently available to access the Sui network data, along with a overview of how that's gradually evolving for a great deveoper experience.
This document outlines the interfaces that are currently available to access the Sui network data, along with an overview of how that's gradually evolving for a great developer experience.


## Current data access interfaces

You can use either of the following mechanisms to access Sui network data currently:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can use either of the following mechanisms to access Sui network data currently:
Use one of the following mechanisms to access Sui network data:


You can use either of the following mechanisms to access Sui network data currently:

- Directly connect to [JSON-RPC](/references/sui-api.mdx) hosted by a Sui [Full node](guides/operator/sui-full-node.mdx) where the [Mainnet](https://fullnode.mainnet.sui.io:443) or [Testnet](https://fullnode.testnet.sui.io:443) or [Devnet](https://fullnode.devnet.sui.io:443) load balancer URLs abstract Mysten Labs managed Full nodes, OR
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Directly connect to [JSON-RPC](/references/sui-api.mdx) hosted by a Sui [Full node](guides/operator/sui-full-node.mdx) where the [Mainnet](https://fullnode.mainnet.sui.io:443) or [Testnet](https://fullnode.testnet.sui.io:443) or [Devnet](https://fullnode.devnet.sui.io:443) load balancer URLs abstract Mysten Labs managed Full nodes, OR
- Use [JSON-RPC](/references/sui-api.mdx) hosted by a Sui [Full node](guides/operator/sui-full-node.mdx) where the [Mainnet](https://fullnode.mainnet.sui.io:443) or [Testnet](https://fullnode.testnet.sui.io:443) or [Devnet](https://fullnode.devnet.sui.io:443) load balancer URLs abstract Mysten Labs managed Full nodes, OR


- Directly connect to [JSON-RPC](/references/sui-api.mdx) hosted by a Sui [Full node](guides/operator/sui-full-node.mdx) where the [Mainnet](https://fullnode.mainnet.sui.io:443) or [Testnet](https://fullnode.testnet.sui.io:443) or [Devnet](https://fullnode.devnet.sui.io:443) load balancer URLs abstract Mysten Labs managed Full nodes, OR
- Set up your own [custom indexer](/guides/developer/advanced/custom-indexer.mdx) to continuously load the data of interest in a Postgres database, OR
- Utilize a [RPC provider](https://sui.io/developers#dev-tools) (filter by `RPC`) or [Data indexer operator](https://github.com/sui-foundation/awesome-sui?tab=readme-ov-file#indexers--data-services) who have setup their own Full nodes or indexing infrastructure.
Copy link
Contributor

Choose a reason for hiding this comment

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

Thoughts on moving this to the top or alternatively, explaining on the first one that it is not intended for production purposes. Similarly, we could suggest to use an RPC provider for production purposes as the public Mysten Labs ones have some limitations.

Copy link
Contributor

Choose a reason for hiding this comment

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

Love that we're referring to the awesome-sui repo here!

@abhinavg6
Copy link
Author

@amnn @bmwill @ronny-mysten @stefan-mysten - Thanks for all the feedback until now. I've addressed a bunch (some of the suggestions were conflicting with each other, so have updated to one that made sense to me). I've left a couple of things as-is to wait to have more clarity internally (like on overall historical data access narrative), which we can update here later. I expect this document to be a living & breathing artifact that will evolve this entire year in some shape or form.

@stefan-mysten
Copy link
Contributor

Thanks @abhinavg6 for putting this together. My main comment is around having a table for data availability, with explicit information: what data is available, how long, different policies for devnet/testnet/mainnet, etc for gRPC and GraphQL.

@abhinavg6
Copy link
Author

Thanks @stefan-mysten - that is the eventual goal once we have those interfaces in a stable beta about to GA. The purpose of this document is to provide some direction of where we are and where we are going, and the details of each interface will be included in each interface's specific docs that will be linked to from here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants