Mastery Series: Migrating from the SubQuery Managed Service to the SubQuery Network

SubQuery Network
6 min readJun 17, 2024

--

Welcome back to the next instalment of the SubQuery Mastery Series, where we help you navigate the SubQuery Network and ensure you maximise potential rewards. If you’re reading this article you may already be familiar with SubQuery and using our SubQuery Managed Service but want to decentralise your tech stack completely. Here we’ll walk you through the process to migrate your SubQuery Project from our Managed Service to our decentralised Network where our globally distributed indexers will manage your indexing needs.

This process is not necessarily a migration per se, it is simply a matter of deploying to the SubQuery Network and then retiring your Managed Service indexer. We’ll outline both of these processes but first, let us remind you why you should publish your SubQuery Project to our decentralised network.

Why Publish to SubQuery’s Decentralised Network?

The SubQuery Network is the future of web3 infrastructure, it allows you to completely decentralise your infrastructure stack. This provides the following benefits:

  • Unstoppable infrastructure — With almost 100 decentralised and geographically isolated Indexers providing data to your dApps, sleep safe knowing your infra will never go down.
  • Superior performance — Since Indexers are all around the world, they’re closer to your users. Lower latency and faster requests create a better user experience for your users.
  • Infinitely scalable — As your user base grows, more indexers will serve your data allowing you to infinitely scale without interruption.
  • Seamless transition — We’re here to help you migrate, and we’ve made it easy to integrate your dApps with our network client SDKs.

With the SubQuery Network, you can now go to your community and say with confidence “Our dApp is truly decentralised”.

Check your SubQuery Project is Compatible for the Network

Before deploying to the SubQuery Network, you consider the following, as some features are not yet supported on our decentralised network..

  1. The SubQuery Network does not yet support GraphQL subscriptions, so you can’t enable the — subscription command line argument
  2. Your project can generate stable proof of indexing results. This means you should avoid:
  • Random ordered DB operations, e.g. avoid using Promise.all() in your mapping functions.
  • Introducing external data dependent on runtime, e.g. initialising a new current date using new Date().

Deploying to the SubQuery Network

Assuming your SubQuery Project meets all the prerequisites above, you are ready to deploy to the SubQuery Network!

The SubQuery Network is a public permission-less network meaning anyone can deploy their project freely. To do so, head to the SubQuery Explorer and click “Publish New Project”.

The process is as similar to SubQuery’s Managed Service as possible, which means you need to pupublish your project to IPFS first. You can follow the guide here if you haven’t already done this, please enter the project CID and give your project a nice, clear name.

Then you will be asked to enter a project description and other information about the project that Consumers or Node Operators might find interesting. It’s worth making sure these fields are legible and attractive to Node Operators who will index your project. You will need to populate the below:

  • A logo or image
  • Categories that your project can be classified by
  • A website address for your project
  • A link to where the source code can be found
  • Deployment version number, we recommend it follows semantic versioning rules
  • Deployment description, which might include additional information for Node Operators about migration steps or breaking changes in this version

Once your project is deployed, you can easily make changes to your project or deploy a new version by accessing the Managed Project page. Read more here.

Hot Tip: At this stage you should reach out to Node Operators in our Discord to encourage them to start syncing your project, once they do you will be able to create plans and start querying this data. You might also want to consider boosting your project to incentivise Node Operators to do so, and in return receive free queries to it.

Changes to your DApp

We suggest that your client application (the one that will query data from the Network) uses Apollo Client as its primary GraphQL Client. Apollo Client is a comprehensive state management library for JavaScript that enables you to manage both local and remote data with GraphQL. Use it to fetch, cache, and modify application data, all while automatically updating your UI.

Read more about how Apollo Client works here.

Get your Dataset Indexed on the SubQuery Network

Once you have deployed your SubQuery Project(s) to the SubQuery Network and you want to access this indexed dataset, you have officially become a Consumer in the Network. Node Operators will come along and signal they are ready to index your project and you can then create a plan with your favourite Node Operators to index your data at an agreed rate. You will receive an API endpoint with your own API key to plug into your dApp.

Read more about creating plans here.

Once your data is indexed and you are satisfied, it’s time to retire your Managed Service indexer as you are ready to rely on the network and become a completely decentralised project!

Retire your Managed Service Project

No more centralised infrastructure! It’s time to retire your Managed Service SubQuery Project and save costs.

To do so, simply go into your project, select the ellipses and select ‘Delete’. If you later decide that you want to run both a centralised and decentralised indexer, you can always redeploy to our managed service.

Now you’re ready! The SubQuery Network will allow you to build unstoppable apps with superior speed and performance to your hosted indexer. Head to the SubQuery Network app and get started.

If you have questions or concerns, don’t hesitate to reach out to us at support@subquery.network.

About SubQuery

SubQuery Network is innovating web3 infrastructure with tools that empower builders to decentralise the future. Our fast, flexible, and open data indexer supercharges dApps on over 200 networks, enabling a user-focused web3 world. Soon, our Data Node will provide breakthroughs in the RPC industry, and deliver decentralisation without compromise. We pioneer the web3 revolution for visionaries and forward-thinkers. We’re not just a company — we’re a movement driving an inclusive and decentralised web3 era. Let’s shape the future of web3, together.

​​​​Linktree | Website | Discord | Telegram | Twitter | Blog | Medium | LinkedIn | YouTube

--

--

SubQuery Network

SubQuery is here to help you transform and query the world’s data for a web3.0 future. https://subquery.network/