Publishing your Subgraph Project
Benefits of hosting your project with OnFinality’s Indexing Service
Subgraphs are now supported in OnFinality’s Indexing Service
Run your projects side by side together with OnFinality’s Subgraph hosting. One hosting provider for all your data indexing needs. Read more about how to quickly deploy and host your Subgraphs in the OnFinality Indexing Service.
The biggest dApps depend on OnFinality’s enterprise level Indexing Service. With 100's of millions of daily requests and hundreds of active projects, OnFinality’s Indexing Service provides industry leading hosting for our customers.
We'll run your SubQuery and Subgraph projects for you in a high performance, scalable, and managed public service.
This service is being provided to the community with a generous free tier! You can host your first two projects for absolutely free!
You can upgrade to take advantage of the following paid services:
Production ready hosting for mission critical data with zero-downtime blue/green deployments
Dedicated databases
Multiple geo-redundant clusters and intelligent routing
Advanced monitoring and analytics.
Publish your Subgraph project to IPFS
In order to publish a Subgraph project to the OnFinality Indexing Service, you must first upload it to IPFS and retrieve a publicly accessible IPFS CID.
There are two ways to do this. First, if the Subgraph is already live on the Graph Network, you can retrieve the IPFS CID from the Graph Explorer. In the Graph Explorer this value is called the Deployment ID on the website.
Alternatively, if you have not deployed the Subgraph project on the Graph Network, you can use the Graph's command line interface graph build -i https://unauthipfs.subquery.network/ipfs/api/v0
. This will return you an IPFS CID that you can use.
Login to OnFinality Indexing Service
To create your first project, head to OnFinality Indexing Service. You'll need to authenticate with your GitHub account to login.
On first login, you will be asked to authorise OnFinality’s Indexing Service. We only need your email address to identify your account, and we don't use any other data from your GitHub account for any other reasons. In this step, you can also request or grant access to your GitHub Organisation account so you can post Subgraph projects under your GitHub Organisation instead of your personal account.
OnFinality Indexing Service is where you manage all your hosted projects uploaded to the OnFinality Indexing Service platform. You can create, delete, and even upgrade projects all from this application.
If you have a GitHub Organisation accounts connected, you can use the switcher on the header to change between your personal account and your GitHub Organisation account. Projects created in a GitHub Organisation account are shared between members in that GitHub Organisation. To connect your GitHub Organisation account, you can follow the steps here.
Create Your First Project
Before starting, please make sure that your Subgraph project codebase is published to IPFS.
You must use the UI directly to publish your Subgraph
Start by clicking on "Create Project". You'll be taken to the new project form. Start by selecting what project type you would like to deploy (Subgraph), and then follow the steps and enter the following (you can change this in the future):
Project Name: Name your project.
Description: Provide a description of your project.
Database: Premium customers can access dedicated databases to host production Subgraph projects from. If this interests you, you can contact sales@onfinality.io to have this setting enabled.
Visible in Explorer: If selected, this will show the project from the public explorer to share with the community.
Create your project and you'll see it on your Project's list. Next, we just need to deploy a new version of it.
Deploy your First Version
You can only use the UI to deploy a new version of your Subgraph project to the OnFinality Indexing Service.
While creating a project will setup the display behaviour of the project, you must deploy a version of it before it becomes operational. Deploying a version triggers an indexing operation to start, and sets up the required query service to start accepting GraphQL requests. You can also deploy new versions to existing projects here.
With your new project, you'll see a "Deploy your first version" button. Click this, and fill in the required information about the deployment:
CID: Provide your IPFS deployment CID. Retrieve this by following the steps above to retrieve the IPFS CID
Manifest: The details are obtained from the contents of the provided CID.
Override Network and Dictionary Endpoints: You can override the endpoints in your project manifest here.
Advanced Settings: There are numerous advanced settings which are explained via the in built help feature.
If deployed successfully, you'll see the indexer start working and report back progress on indexing the current chain. This process may take time until it reaches 100%.
Next Steps - Connect to your Project
Once your deployment has successfully completed and our nodes have indexed your data from the chain, you'll be able to connect to your project via the displayed GraphQL Query endpoint.
Alternatively, you can click on the three dots next to the title of your project, and view it on SubQuery Explorer. There you can use the in browser playground to get started.