SubQuery Hero Course Overview

vizimnokh
4 min readMar 20, 2022

--

The course is designed to enhance the skills and empowerment of developers in SubQuery ecosystem by providing them with a modular program and help them to learn how to build a SubQuery data source and to develop subqueries, deploy them in SubQuery Projects, and build new blockchain applications.

What is the purpose of the course?

As we know, the SubQuery was designed to help developers easily and quickly benefit from blockchain data. This is why attracting new developers and teaching them the skills they need to build the decentralised applications of tomorrow is incredibly important to the success of its community.

What about the benefits of the program?

  • Free access
  • Available online
  • Simple and quick
  • Certified

And what the outcome will be?

You will be able to

  • create your own SubQuery Project
  • deploy in SubQuery Projects
  • run your project and query your data

Short course overview

Prerequisites

1.NPM Package Manager

2.SubQuery CLI (eSUBQL/CLI), Docker

3.Start each new module after completion of previous one

Hero course content

1 Module— Getting started

The creation of the first Hello World application and making a simple query.

This project will use the subql CLI to create an empty project shell and then code will be provided to query the Polkadot mainnet for the blockheight.

A Docker environment will be used to run this example for simplicity.

2 Module — SubQuery Basics

What SubQuery is and how to work with it.

Lesson 1 — The manifest file

How The Manifest Files and Network Filters work.

Lesson 2 — The schema file

A quick introduction to the schema file and how it works.

Lesson 3 — The mappings file — Block Handler

Learning what data can be extracted from a substrate chain using a block handler.

Lesson 4 — The mappings file — Event Handler

Learning about Indexing all transactions in Polkadot and Event Handlers.

Lesson 5 — The mappings file — Call Handler

Learning about Call Handlers and how they work.

Exercise: Account Balances

You will take the starter project and focus on using an event handler to extract the balance of each account.

3 Module — Relationships

How to work with Graphql schemas and learn new information about one-to-many, many-to-many entities.

Lesson 1 — One to many entities

Focus on understanding a popular one to many entity relationships.

Exercise 1: Account Transfer

Create a project that allows to query for accounts and determine how much was transferred to what receiving address.

Lesson 2 — Many to many entities

Focus on understanding many to many relationships work.

Exercise 2 — Council Proposal

Create a project that allows to query for the number of votes that councillors have made and how many votes a given proposal has received.

Lesson 3 — Reverse lookups

Focus on understanding what reverse lookups are

Exercise 3: Account Transfer with Reverse Lookup

4 Module — Aggregation and Event Calls

You will aggregate data and try some coding.

Lesson 1— Staking rewards

Lesson 2 — Summing rewards

Lesson 3 — Summing rewards with individual stakes

Lesson 4 — Reward v Rewarded

Exercise

Index staking rewards and aggregate them over for a particular account.

Determine how much reward an account has accumulated over time.

5 Module — SubQuery Project & Explorer

You will learn how to deploy project, how to use SubQuery slots and explore some projects in three videos.

Lesson 1 — Deploying a project

Lesson 2 — What are SubQuery slots and how to use them?

Lesson 3 — Exploring projects

  • Understanding GraphQL (to explore other projects)
  • Understanding how to read the project docs

Exercise: Deploying a project to SubQuery Project

Learn how to deploy a project to SubQuery Project, and learn about SubQuery Explorer.

6 Module — Tips & Tricks

You will learn what SubQuery Project is, how to deploy a project to SubQuery Project, and learn about SubQuery Explorer.

Block v Events v Calls

Understanding how things work under the covers. SubQuery has three handlers to process blockchain data. They are block, event, and call handlers.

Using a dictionary

Understanding how a dictionary works.

Event & Extrinsic Names

  • Polkadot Documentation
  • Polkadot blockchain explorer — become familiar with what information is available to be extracted
  • Connecting to the API — learning to connect directly to the Polkadot API via command line provides several advantages
  • Fetching a block
  • Getting extrinsics within a block
  • Getting events at a certain block height

Type Safe Properties

Ensure that an operation is working on the right kind of data at some point before the operation is actually performed.

Logging

To log data to the CLI from within the mappings functions.

Debugging

Use a Node.js inspector in conjunction with Chrome developer tools.

Changing the batch block size

Using a smaller batch size can reduce memory usage and not leave users hanging for large queries to speed up indexing of simple projects

Changing the starting block

Note that some events only start to occur at higher block height so one way to test a mapping function faster is to adjust the starting block height.

Hero Course test and certification

Hero Course is an incredible opportunity for beginners and experienced developers alike. Thanks to the video lectures, it’s easy to understand what the lecturer is talking about and follow along to practically learn everything the course teaches. I wish you a pleasant learning experience and a quick update of your knowledge.

More information you can find here

Website | Medium | Blog | Docs | Twitter | Telegram | Youtube

--

--

vizimnokh

Smth new for me and russian introduction into crypto projects