How to index Network for your Subgraph: The step-by-step Guide
Tags: subgraphs
Published: 2024-02-27 08:20:58

<p>Web3 applications' need for reliable, on-chain data is never-ending. Be it a trading app, gaming platform, or <a href="https://www.zeeve.io/blog/a-simple-and-comprehensive-guide-on-non-fungible-tokens/">NFT marketplaces</a>– each of these use cases is now tapping into <a href="https://www.zeeve.io/subgraphs/">Subgraphs</a> for non-stop and effortless web3 data querying. But, what if you want to query data from a specific network that does not appear on decentralized protocols or with any hosted service providers? Don’t panic, read this step-by-step guide and index your network for subgraphs.&nbsp;</p>
<figure class="wp-block-image size-large"><a href="https://www.zeeve.io/subgraphs/"><img src="https://www.zeeve.io/wp-content/uploads/2024/02/Leverage-high-performing-data-indexers-for-your-dApps.-1-1024x130.jpg" alt="" class="wp-image-60308"/></a></figure>
<h2 class="wp-block-heading" id="h-why-is-your-subgraph-network-missing">Why is your Subgraph network missing?&nbsp;</h2>
<p>The non-availability of a network means it is not yet indexed on the <a href="https://www.zeeve.io/subgraphs/">Subgraph</a> platforms where you find it. For example, if we talk about The Graph Network’s hosted service, it is sunsetting and therefore, does not offer <a href="https://thegraph.com/docs/en/developing/supported-networks/">support to many networks</a>. Likewise, you may not be able to find a few networks with any other subgraph providers. There can be two possible scenarios when finding a network for subgraphs is a challenge. Let’s discuss them:</p>
<ul><!-- wp:list-item -->
<li>The first and most common scenario is when you are <a href="https://www.zeeve.io/subgraphs/">deploying a subgraph</a> for a public protocol for which the other providers are not providing a subgraph yet. The reason for this can be anything, maybe the less or somewhat medium popularity of the network, but you are not able to find a reliable infrastructure provider for them.<br></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>The next scenario is for <a href="https://www.zeeve.io/rollups/">Layer2 rollups</a>, <a href="https://www.zeeve.io/appchains/">appchains</a>, and permissioned EVM chains. Let’s say you want to <a href="https://www.zeeve.io/subgraphs/">deploy a subgraph</a> for a <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">CDK chain</a> or a <a href="https://www.zeeve.io/appchains/zksync-hyperchains-zkrollups/">Zksync hyperchain</a>, which was developed recently. The same goes for appchains and permissioned EVM networks like <a href="https://www.zeeve.io/enterprise-protocols/deploy-hyperledger-besu/">Hyperledger Besu</a>. Getting their network for subgraphs can be difficult.&nbsp;&nbsp;</li>
<!-- /wp:list-item --></ul>
<h2 class="wp-block-heading">How to index your network for Subgraph? Step-by-step process.</h2>
<p>For both scenarios above—in case of <a href="https://www.zeeve.io/rollups/">rollup</a><a href="https://www.zeeve.io/appchains/">/appchain</a>/permissioned chain or a public protocol, <a href="https://www.zeeve.io/subgraphs/">Zeeve’s subgraph service</a>; Traceye provides an efficient solution. With Traceye, you can index any network of your choice in a low-code, hassle-free way, along with a rapid-fast launch of subgraphs, their management, and consistent scaling.&nbsp;&nbsp;</p>
<p>Here, you will have two options for indexing network for <a href="https://www.zeeve.io/subgraphs/">subgraphs</a>; the first is to set up your dedicated Graph node, or else you can opt for a shared subgraph. Let’s dive a little deeper.&nbsp;</p>
<h3 class="wp-block-heading">Option:1 Setting up dedicated Graph Node for your network</h3>
<p>Dedicated graph node is Zeeve’s one of the latest <a href="https://www.zeeve.io/subgraphs/">subgraph services</a>, which brings you a dedicated Graph node server with powerful server specs and high storage capacity, enabling you to deploy as many subgraphs as you want, perform endless queries, and store diverse entities according to the query requirements.&nbsp;</p>
<p>Whether you want to index an <a href="https://www.zeeve.io/appchains/">appchain network</a>, rollup, or permissioned protocol, having a dedicated graph node brings a solution that caters to all sorts of your requirements. Within this dedicated Graph node, there’s a provision to add your own RPC URL. This RPC URL can be of a <a href="https://www.zeeve.io/rollups/">Layer2 rollup chain</a>, <a href="https://www.zeeve.io/appchains/">appchain</a>, or any permissioned EVM chains that you want to index and query data out of.&nbsp;</p>
<p>For those who are building production-grade applications and are looking to deploy more than one subgraph, plus those who do not want any limit on queries,&nbsp; a dedicated subgraph node is an ideal choice. They will get a high throughput archive node RPC URL at a discounted rate. On top of this, dedicated Graph nodes on <a href="https://www.zeeve.io/">Zeeve</a> can leverage value-added features like <a href="https://www.zeeve.io/blog/mastering-real-time-data-streaming-game-with-webhooks-in-zeeve-subgraph">Subgraph webhooks</a>, queries add-on and the option for community subgraph.</p>
<h3 class="wp-block-heading">Option:2 Indexing your network through shared indexers</h3>
<p>Besides setting up a dedicated graph node and <a href="https://www.zeeve.io/subgraphs/">Zeeve subgraph service</a>, Traceye offers ‘Shared indexers’ on a subscription-based model. This option is useful for projects in the testing phase that want to index data from any public network, <a href="https://www.zeeve.io/appchains/">appchain</a>, or <a href="https://www.zeeve.io/rollups/">rollup</a>. These types of users can opt for shared indexers to perform a limited number of queries. However, Zeeve allows you to buy additional queries with your existing plan. Here’s the step-by-step process for indexing your custom network with Zeeve.</p>
<p><strong>Step:1 </strong>Create account or login to the<a href="https://www.zeeve.io/"> Zeeve platform</a>.</p>
<p><strong>Step:2</strong> Navigate to ‘Hosted Subgraph’ on the dashboard and click on ‘Buy Subgraph’ to get a <a href="https://www.zeeve.io/subgraphs/">custom hosted subgraph service</a>.&nbsp;</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/95g6dkye1yb95rvzkw2y.png)
<p>You have the option to choose the number of subgraphs, get services like Community Subgraph, and addons like webhook, additional queries, and additional storage entities. Customize your plan as required and complete its payment.</p>
<p><strong>Step:3</strong> Again, navigate to <a href="https://www.zeeve.io/subgraphs/">Hosted Subgraphs</a> and launch your subgraph. Click on ‘Add Subgraph’ or start with ‘New Subgraph’.</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ilgqsurk6phez184wl19.png)
<p>Adding subgraphs will open a drop-down menu, allowing you to create new subgraphs and import any existing ones. Subgraph creation and importing is self-explanatory; hence, let’s discuss community <a href="https://www.zeeve.io/subgraphs/">subgraphs</a>.&nbsp;</p>
<p>This feature will allow you to create active subgraphs that are popular across the web3 community and are indexed already on other platforms. This means you don't need to <a href="https://www.zeeve.io/subgraphs/">launch subgraphs</a> from scratch; just activate the popular ones and create a pipeline to index important data from them.</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dmltpzpc1q0qqxtwndyr.png)
<p>With this option, you can launch and manage a range of subgraphs within a single setup. Let’s proceed with ‘New Subgraph’ as we are currently indexing a new network.</p>
<p><strong>Step:4</strong> Provide your subgraph a name, choose workspace (it can default or customized), and choose your blockchain network from the Blockchain Network drop-down. If your network is present in the list, select it. If it’s not, then choose the <strong>custom </strong>option.&nbsp;</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/213m0xoasq4qsyqlhoyu.png)
<p><strong>Step:5</strong> Enter the RPC endpoint of the network for which you want to deploy the subgraph. If you don’t have one, <a href="https://www.zeeve.io/">Zeeve</a> will help you get configured RPC URLs for a range of <a href="https://zeeve.io/blockchain-protocols/">blockchain networks</a>, <a href="https://www.zeeve.io/appchains/">appchains</a>, and <a href="https://www.zeeve.io/rollups/">rollups</a>. As you can see in the below image, we have added an RPC endpoint for Astar Network as we will be indexing data from this particular network.&nbsp;</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z5lznxpc8nka1jgjso9e.png)
<p>Click on ‘Add Subgraph’ and your subgraph will be launched instantly. From the dashboard itself, you can check the status of the subgraph, such as status- deployed/not deployed, block synchronization status, subgraph creation date, and more. Plus, you will get a deployment command to <a href="https://www.zeeve.io/subgraphs/">deploy your subgraph</a> and a query url to perform data queries once the subgraph is fully synced.</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r2dzyabdagi2u37ybx98.png)
<p>Here’s the deployment command:</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nmjm5hy06fu1ije1znfj.png)
<p>And, the Query URL:</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84csn47burhw79qbi2nc.png)
<p>Rest of the steps will be similar to what we discussed in our previous <a href="https://www.zeeve.io/blog/how-to-deploy-subgraphs-on-zeeve-step-by-step-guide/">Subgraph deployment guide</a>. It has covered everything, from subgraph creation (including manifest writing, compiling GraphQL schema, or getting ABI files), importing of existing subgraphs, to webhook enabling. This will allow you to get an in-depth understanding of how you can index a network for <a href="https://www.zeeve.io/subgraphs/">Subgraph with Zeeve</a> and in the meantime, you don't miss anything that is important.&nbsp;</p>
<h2 class="wp-block-heading">Wrapping up!</h2>
<p>As discussed, the whole process of indexing networks for subgraphs is straightforward with the <a href="https://www.zeeve.io/subgraphs/">Zeeve subgraph service</a>. Whether it's about creating a new subgraph from scratch, launching custom networks, or migrating any existing subgraph from a different infrastructure to Zeeve-managed infrastructure,. Also, if you seek hands-on support from our team on building a <a href="https://www.zeeve.io/subgraphs/">custom subgraph</a> from ground level, feel free to contact us.&nbsp; For more information about Zeeve’s Subgraphs services or our comprehensive blockchain services, <a href="https://www.zeeve.io/talk-to-an-expert/">schedule a call</a> or send us your queries via mail.&nbsp;</p>