0.0.41 • Published 1 day ago

envio v0.0.41

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
1 day ago

Envio CLI tool

A fast, reliable, customizable indexing blockchain solution.

Envio is a reliable real-time indexing solution designed to simplify the ingestion of events from EVM-compatible chains and transform this data into custom GraphQL APIs. These APIs play a pivotal role in enabling seamless user experiences in blockchain application front-ends. With Envio, the emphasis is on refining the developer's experience when using an indexer, ensuring the service is swift, secure, and trustworthy.

Note: For a thorough understanding and to dive deeper into each feature, refer to the original documentation website.

Table of Contents

Note: Envio is built for javascript, typescirpt and rescript. However in this readme we will only use typescript for examples. Refer to the documentation website for full docs.

Quickstart

For a slightly larger tutorial please see the Greeter contract tutorial.

Installation

Prerequisites

To install the envio tool globally, run:

npm i -g envio

To view the available CLI commands:

envio --help

Usage

Important Commands Overview:

  • envio
  • envio init - Auto-generates configuration, GraphQL schema, and event handlers based on the Greeter template.
  • envio codegen - Generates code after setting configuration and schema files.
  • envio start - Start the indexer.
  • envio dev - Starts all the processes required for local development of the indexer.
  • envio stop - Delete the database and stop all processes

For a detailed breakdown of commands, refer to the documentation.

Event Handlers

After establishing the configuration and schema files, execute:

npx envio codegen

Custom code to make it easy to retrieve and process events from our contract is generated. More specifically every event necessitates the registration of two core functions from our generated code:

  • Loader function
  • Handler function

Loader Function

Loader functions are responsible for loading specific entities (defined in schema.graphql) to be modified by the event. They are called in the following format:

<ContractName>Contract_ < EventName > _loader;

NOTE: the syntax is slightly different for javascript and rescript. See loader docs.

Handler Function

Handler functions modify the entities loaded by the loader function. They incorporate the essential logic for updating entities with the raw data produced by the event. They're called as:

<ContractName>Contract_ < EventName > _handler;

NOTE: the syntax is slightly different for javascript and rescript. See handler docs.

For a comprehensive guide on Event Handlers, please refer to the provided documentation.

Logging

Logging is integral for tracking the progress and debugging issues in the indexer. Envio utilizes the pino logging library, which can be integrated with tools like kibana to extract metrics and insights.

For user-level logging, context-based functions are provided:

  • <context>.log.debug
  • <context>.log.info
  • <context>.log.warn
  • <context>.log.error
  • <context>.log.errorWithExn

Further details about developer logging, including log levels, can be found in the documentation.

Contribution & Support

🔧 This product under active development. Please always refer to the main documentation for the latest updates.

For support and updates, follow Envio on Twitter or join the Discord community.

If you have specific suggestions or requirements, kindly reach out and contribute to the development of Envio.

Our common issues page may also have useful help for you

0.0.41

3 days ago

0.0.40

16 days ago

0.0.39

21 days ago

0.0.38

1 month ago

0.0.37

1 month ago

0.0.36

1 month ago

0.0.35

2 months ago

0.0.34

2 months ago

0.0.33

2 months ago

0.0.32

2 months ago

0.0.31-tui-demo

2 months ago

0.0.31-dev-mode

3 months ago

0.0.31

3 months ago

0.0.30

3 months ago

0.0.29

4 months ago

0.0.28

4 months ago

0.0.27

4 months ago

0.0.26

5 months ago

0.0.21

7 months ago

0.0.22

6 months ago

0.0.23

6 months ago

0.0.24

6 months ago

0.0.25

5 months ago

0.0.20

7 months ago

0.0.15

8 months ago

0.0.16

8 months ago

0.0.17

7 months ago

0.0.18

7 months ago

0.0.19

7 months ago

0.0.11

8 months ago

0.0.12

8 months ago

0.0.13

8 months ago

0.0.14

8 months ago

0.0.3

9 months ago

0.0.9

8 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.10

8 months ago

0.0.0-branch-fix3

8 months ago

0.0.1-alhpa.0

11 months ago

0.0.0-unstable-temp

12 months ago

0.0.0-blank-slate

12 months ago

1.0.0

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago