Skip to main content

Quickstart

Installation

Follow the installation steps outlined here.

Initialise your indexer

cd into the folder of your choice and run

envio init

Name your indexer

? Name your indexer:

Choose the directory where you would like to setup your project (default is the current directory)

? Set the directory:  (.) .

Select to start from a template

? Would you like to start from a template or migrate from a subgraph?
> "Template"
"SubgraphMigration"
[↑↓ to move, enter to select, type to filter]

Then choose a template out of the possible options

? Which template would you like to use?
> "Blank"
"Greeter"
"Erc20"
[↑↓ to move, enter to select, type to filter]

Then choose a language from Javascript, Typescript or Rescript to write the event handlers file.

? Which language would you like to use?
> "Javascript"
"Typescript"
"Rescript"
[↑↓ to move, enter to select, type to filter]

This will create the config, schema and event handlers files according to the template and language chosen.

Specify the config and schema files according to your project

This step can be skipped if you want to continue building an indexer for the template chosen in the previous step.

Now you can configure the files to your configuration.

  • How to specify the config file.
  • How to specify the schema file.

Write the event handlers for your project

This step can be skipped if you want to continue building an indexer for the template chosen in the previous step.

Once you have set up your config and schema file you can run envio codegen to generate the functions that you will use in your handlers.

envio codegen

Once the indexing files have been generated, you are ready to write the event handlers for your project.

Click here for a guide on how to define your event handlers.

Run the indexer locally

Before running the Envio CLI command to start the indexer locally, please make sure you have Docker running.

Run the indexer

envio dev

This will automatically open up the Hasura dashboard where you can view the data that has been indexed.

Admin-secret for local Hasura is testing.

Stopping the indexer

To delete the docker images used for the local development environment, run

envio stop