envio-linux-x64 0.0.5 → 0.0.6-fuel
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +116 -0
- package/bin/envio +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1 +1,117 @@
|
|
1
1
|
# Envio CLI tool
|
2
|
+
|
3
|
+
A fast, reliable, customizable indexing blockchain solution.
|
4
|
+
|
5
|
+
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.
|
6
|
+
|
7
|
+
_Note: For a thorough understanding and to dive deeper into each feature, refer to the original [documentation website](https://docs.envio.dev)._
|
8
|
+
|
9
|
+
## Table of Contents
|
10
|
+
|
11
|
+
<!-- TODO: features summary will be nice to add -->
|
12
|
+
<!-- - [Features](#features) -->
|
13
|
+
|
14
|
+
- [Quickstart](#quickstart)
|
15
|
+
- [Installation](#installation)
|
16
|
+
- [Usage](#usage)
|
17
|
+
- [Event Handlers](#event-handlers)
|
18
|
+
- [Logging](#logging)
|
19
|
+
- [Contribution & Support](#contribution-&-support)
|
20
|
+
|
21
|
+
_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](https://docs.envio.dev) for full docs._
|
22
|
+
|
23
|
+
## [Quickstart](https://docs.envio.dev/docs/quickstart)
|
24
|
+
|
25
|
+
For a slightly larger tutorial please see the [Greeter contract tutorial](https://docs.envio.dev/docs/greeter-tutorial).
|
26
|
+
|
27
|
+
## [Installation](https://docs.envio.dev/docs/installation)
|
28
|
+
|
29
|
+
### Prerequisites
|
30
|
+
|
31
|
+
- [Node.js](https://nodejs.org/en/download/current)
|
32
|
+
- [pnpm](https://pnpm.io/installation) on [npm](https://www.npmjs.com/get-npm)
|
33
|
+
- [Docker Desktop](https://www.docker.com/products/docker-desktop/)
|
34
|
+
|
35
|
+
To install the `envio` tool globally, run:
|
36
|
+
|
37
|
+
```bash
|
38
|
+
npm i -g envio
|
39
|
+
```
|
40
|
+
|
41
|
+
To view the available CLI commands:
|
42
|
+
|
43
|
+
```bash
|
44
|
+
envio --help
|
45
|
+
```
|
46
|
+
|
47
|
+
## Usage
|
48
|
+
|
49
|
+
**Important Commands Overview:**
|
50
|
+
|
51
|
+
- `envio`
|
52
|
+
- `envio init` - Auto-generates configuration, GraphQL schema, and event handlers based on the Greeter template.
|
53
|
+
- `envio codegen` - Generates code after setting configuration and schema files.
|
54
|
+
- `envio start` - Start the indexer.
|
55
|
+
- `envio dev` - Starts all the processes required for local development of the indexer.
|
56
|
+
- `envio stop` - Delete the database and stop all processes
|
57
|
+
|
58
|
+
For a detailed breakdown of commands, refer to the [documentation](https://docs.envio.dev/docs/cli-commands).
|
59
|
+
|
60
|
+
## Event Handlers
|
61
|
+
|
62
|
+
After establishing the configuration and schema files, execute:
|
63
|
+
|
64
|
+
```bash
|
65
|
+
npx envio codegen
|
66
|
+
```
|
67
|
+
|
68
|
+
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:
|
69
|
+
|
70
|
+
- Loader function
|
71
|
+
- Handler function
|
72
|
+
|
73
|
+
### Loader Function
|
74
|
+
|
75
|
+
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:
|
76
|
+
|
77
|
+
```typescript
|
78
|
+
<ContractName>Contract_ < EventName > _loader;
|
79
|
+
```
|
80
|
+
|
81
|
+
**NOTE**: the syntax is slightly different for javascript and rescript. See [loader docs](https://docs.envio.dev/docs/event-handlers#loader-function).
|
82
|
+
|
83
|
+
### Handler Function
|
84
|
+
|
85
|
+
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:
|
86
|
+
|
87
|
+
```typescript
|
88
|
+
<ContractName>Contract_ < EventName > _handler;
|
89
|
+
```
|
90
|
+
|
91
|
+
**NOTE**: the syntax is slightly different for javascript and rescript. See [handler docs](https://docs.envio.dev/docs/event-handlers#handler-function).
|
92
|
+
|
93
|
+
For a comprehensive guide on Event Handlers, please refer to the [provided documentation](https://docs.envio.dev/docs/event-handlers).
|
94
|
+
|
95
|
+
## Logging
|
96
|
+
|
97
|
+
Logging is integral for tracking the progress and debugging issues in the indexer. Envio utilizes the [pino](https://github.com/pinojs/pino/) logging library, which can be integrated with tools like [kibana](https://www.elastic.co/what-is/kibana) to extract metrics and insights.
|
98
|
+
|
99
|
+
For user-level logging, context-based functions are provided:
|
100
|
+
|
101
|
+
- `<context>.log.debug`
|
102
|
+
- `<context>.log.info`
|
103
|
+
- `<context>.log.warn`
|
104
|
+
- `<context>.log.error`
|
105
|
+
- `<context>.log.errorWithExn`
|
106
|
+
|
107
|
+
Further details about developer logging, including log levels, can be found in the [documentation](https://docs.envio.dev/docs/logging).
|
108
|
+
|
109
|
+
## Contribution & Support
|
110
|
+
|
111
|
+
🔧 This product under active development. Please always refer to the main documentation for the latest updates.
|
112
|
+
|
113
|
+
For support and updates, follow Envio on [Twitter](https://twitter.com/envio_indexer) or join the [Discord community](https://discord.gg/DhfFhzuJQh).
|
114
|
+
|
115
|
+
If you have specific suggestions or requirements, kindly reach out and contribute to the development of Envio.
|
116
|
+
|
117
|
+
Our [common issues](https://docs.envio.dev/docs/common-issues) page may also have useful help for you
|
package/bin/envio
CHANGED
Binary file
|