<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: geniusyinka</title>
    <description>The latest articles on DEV Community by geniusyinka (@yunggenius).</description>
    <link>https://dev.to/yunggenius</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F292772%2F1e38488d-1524-4ee3-b711-49f98bc0b73a.jpeg</url>
      <title>DEV Community: geniusyinka</title>
      <link>https://dev.to/yunggenius</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yunggenius"/>
    <language>en</language>
    <item>
      <title>Getting Started with SubQuery Managed Service</title>
      <dc:creator>geniusyinka</dc:creator>
      <pubDate>Mon, 04 Mar 2024 19:46:01 +0000</pubDate>
      <link>https://dev.to/yunggenius/getting-started-with-subquery-managed-service-2eb2</link>
      <guid>https://dev.to/yunggenius/getting-started-with-subquery-managed-service-2eb2</guid>
      <description>&lt;p&gt;Getting data from the blockchain can be difficult, slow, and painful. This is the exact problem that SubQuery solves.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://subquery.network/"&gt;SubQuery&lt;/a&gt; is an open-source blockchain indexer that makes it easy to work with blockchain data. It allows developers to transform blockchain data into a queryable state so that it can be used in decentralized applications simply via APIs.&lt;/p&gt;

&lt;p&gt;While you can run your subquery projects locally or on any cloud provider of your choosing, SubQuery also provides a managed hosting service to host your projects and serve your applications. In this article, I will explore SubQuery Managed Service and also deploy a basic project atop the service.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introducing SubQuery Managed Service&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;SubQuery Managed service is an enterprise-level hosting solution provided by SubQuery for developers to publish indexers without the burden of managing any indexing infrastructure. It offers a free tier to host your first two projects before upgrading to a paid plan.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Benefits of SubQuery Managed Service&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Some of the benefits of hosting via the Managed Service are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;99.9% Uptime Hosting: SubQuery is designed to provide reliable and consistent uptime for your applications.&lt;/li&gt;
&lt;li&gt;Dedicated Databases: For production applications, SubQuery offers an option to upgrade to a private dedicated database for your indexing needs.&lt;/li&gt;
&lt;li&gt;Advanced monitoring and analytics: SubQuery provides a detailed analytics panel to monitor the health of your applications.&lt;/li&gt;
&lt;li&gt;Intelligent multi-cluster routing: SubQuery will direct traffic to the most efficient cluster based on location and load.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;How to Publish Indexers to the Managed Service&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Let's explore how to deploy a subquery project to the managed service.&lt;/p&gt;

&lt;p&gt;To demonstrate, we will publish the &lt;code&gt;[osmosis-dex-data](https://github.com/subquery/cosmos-subql-starter/tree/main/Osmosis/osmosis-dex-data)&lt;/code&gt; project by SubQuery in this guide. You can follow the same steps to publish your project. If you do not have a project setup, check out the SubQuery documentation on &lt;a href="https://academy.subquery.network/run_publish/run.html"&gt;how to set up a project locally on your machine&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 1: Create an account&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The first step is to create a Managed Service account. Go to &lt;a href="https://managedservice.subquery.network/"&gt;SubQuery Managed Service&lt;/a&gt; to register or log in if you already have an account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgiigiy852kj19xd5sxrz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgiigiy852kj19xd5sxrz.png" alt="Image description" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is important so you can grab your &lt;code&gt;SUBQL_ACCESS_TOKEN&lt;/code&gt;, which is vital for the next step in the process.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 2: Configure Environment Variables&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Now that you have created an account. Let's grab our private &lt;code&gt;SUBQL_ACCESS_TOKEN&lt;/code&gt; via the UI.&lt;/p&gt;

&lt;p&gt;Select your profile at the top right of the navigation menu. Select “Refresh Token” from the drop-down.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8i3y63n87mslqj2oca7a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8i3y63n87mslqj2oca7a.png" alt="Image description" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy the token from the pop-up that appears.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs1z8murnw9r3hfs0b8o3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs1z8murnw9r3hfs0b8o3.png" alt="Image description" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, create and set an environment variable either in your local config file or from your terminal,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;// For PC
SET &lt;span class="nv"&gt;SUBQL_ACCESS_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;token&amp;gt;

//For Mac/Linux
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;SUBQL_ACCESS_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;token&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;&amp;lt;token&amp;gt;&lt;/code&gt; with the token you copied from the UI.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: You will need to update your enviroment variables everytime you click on “Refresh Token” on your dashboard UI.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 3: Publish your SubQuery project to IPFS&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Now that we've configured the environment variables, the next step is to push your codebase to IPFS. IPFS makes it available for everyone and reduces the dependency on centralized services like GitHub.&lt;/p&gt;

&lt;p&gt;In your terminal, run the command below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;// Publish it from your project&lt;span class="s1"&gt;'s root directory
subql publish
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After successfully publishing the project, you should see a confirmation message in your terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Building and packing code... &lt;span class="k"&gt;done
&lt;/span&gt;Uploading SupQuery project to IPFS
SubQuery Project uploaded to IPFS: QmSU48e2FfCAYB151eJdGc7kDYZBJRXgu6qkUf5Gv48zMr  //---CID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the CID and save it for later.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 4: Create a SubQuery Project&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Your SubQuery project is where you manage all your hosted projects uploaded to the SubQuery platform. You can create, delete, and even upgrade projects from the dashboard.&lt;/p&gt;

&lt;p&gt;On your dashboard, Select “Create your SubQuery Project”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft1w5clylqhx3oa7jksmy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft1w5clylqhx3oa7jksmy.png" alt="Image description" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll be taken to the new project form. Here, you can fill in the project name, description, database type, and project visibility status.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkmztfi273qxjwxglj4s1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkmztfi273qxjwxglj4s1.png" alt="Image description" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Project Logo: You can upload a custom logo or leave the default image.&lt;/p&gt;

&lt;p&gt;Project Name: Give your project a name based on your project or the data you are indexing.&lt;/p&gt;

&lt;p&gt;Description: A demonstration for an article on SubQuery's Managed Service.&lt;/p&gt;

&lt;p&gt;Database: “Shared Database”. You will need to upgrade to a paid plan to access dedicated databases to host production SubQuery projects. For this demonstration and most experimentation, the “Share Database” option is just fine.&lt;/p&gt;

&lt;p&gt;Visible in Explorer: If selected, this will show the project from the public SubQuery explorer to share with the community.&lt;/p&gt;

&lt;p&gt;Once your project is successfully created, the system will redirect to the Project dashboard, where you will find details and an option to deploy your indexer to either the production or staging slot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqzvwktbitm749vbv3px3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqzvwktbitm749vbv3px3.png" alt="Image description" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 5: Deploy your indexer to Production&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In the previous step, we created the display behaviour of the project by configuring the basic details like name, description and so on; now, we must deploy a version of it before it becomes operational. Deploying a version triggers a new SubQuery indexing operation to start and sets up the required query service to begin accepting GraphQL API requests.&lt;/p&gt;

&lt;p&gt;To deploy a version, select “Deploy your first version” on your project's dashboard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fboz2199fkbfcy5la9prc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fboz2199fkbfcy5la9prc.png" alt="Image description" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A modal will appear with an option to fill in the &lt;code&gt;Deployment CID&lt;/code&gt;. Paste in the CID you copied from Step 3.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6iuci8lo74zeioq7n9h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6iuci8lo74zeioq7n9h.png" alt="Image description" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If your CID is valid, the system will fetch your indexer's manifest file from IPFS. Once you confirm that everything checks out, click next to configure the Query Service.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9znnphd8kamrm8dryvbs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9znnphd8kamrm8dryvbs.png" alt="Image description" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The default options should be sufficient. However, you can learn more about these in the &lt;a href="https://academy.subquery.network/run_publish/publish.html"&gt;SubQuery documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To configure the indexer service, we need to provide a custom network endpoint. A good point to note here is most public RPC providers will rate limit their public API endpoint which may slow down your SubQuery project. You can get a private endpoint without a rate limit from &lt;a href="https://dillinger.io/link-to-onfinality-docs"&gt;OnFinality&lt;/a&gt; or &lt;a href="https://dillinger.io/links-to-pokt-docs"&gt;POKT&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Fill in your custom endpoint and click “Deploy” to kick off the deployment process.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc5pz8j794n2ryndoirir.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc5pz8j794n2ryndoirir.png" alt="Image description" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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%.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmvsiq3j6gsinke16880t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmvsiq3j6gsinke16880t.png" alt="Image description" width="800" height="141"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 6: Connect to your Project&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Once the process is completed and SubQuery's nodes have indexed your data from the chain, you can now start making requests to your custom GraphQL Query endpoint displayed on the dashboard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1zq35o58peokfprf7gtb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1zq35o58peokfprf7gtb.png" alt="Image description" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What's next?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Congratulations! If you followed along, you have learned how to deploy your indexer project to SubQuery’s production grade Managed Service. You can check out SubQuery documentation for tips that will be useful for &lt;a href="https://academy.subquery.network/run_publish/optimisation.html"&gt;running high performance SubQuery infrastructure&lt;/a&gt; and &lt;a href="https://academy.subquery.network/build/optimisation.html"&gt;improving your indexing and query speed&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
