The Hosted Service
Lesson 3
Normally, we'd want to run a Graph node as part of the decentralized Graph network to listen for NEAR receipts and blocks while also listening to clients' requests to respond with data. However, setting up a local Graph node for NEAR is currently complex and there is very little/no documentation available.
Luckily, The Graph has a Hosted Service that we can upload subgraphs to and interact with. Unfortunately that means The Graph's Hosted Service is acting like a single indexer/single point of failure and you lose the decentralization that comes when running your own node. At some point the process for running a Graph Node for NEAR will get easier/documented, but for now, we need to rely on the Hosted Service.
The Hosted Service will eventually sunset and disappear, but that won't be until The Graph reaches feature parity with its decentralized network of nodes.
Setting Up the Hosted Service
Getting started with the Hosted Service is simply a matter of visiting the site and signing up using your Github login credentials.
Once inside, navigate to your dashboard. This is where all the subgraphs you deploy will reside. Two things to note for later in your dashboard:
- the access token - you'll need that for authorization to deploy subgraphs
- the Add a Subgraph button
It's pretty simple and intuitive to use and although it's a centralized service, it speeds up development as you're not needing to figure out how to install and run anything locally. It also has a GraphQL playground where you will be able to interact with your subgraph to test out queries. Finally, notice the Logs tab which is helpful when looking for the index status of the subgraph or if there are any errors with indexing.
We'll be coming back to this later on in the course when we are ready to deploy our subgraph.
Next Steps
Now that you know where your access token is and where you'll go to setup a space for your subgraph and to interact with it, we'll move on to getting some code ready to run. See you in the next lesson where we'll scaffold out a Graph project.
Maybe you'd rather have us build your NEAR subgraph for you?
Not a problem and it can be pretty quick and inexpensive depending on the complexity of your contract. Get in touch using one of the methods below.