> For the complete documentation index, see [llms.txt](https://docs.v12.trade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.v12.trade/build/getting-started-as-a-developer/data-indexing/envio-indexer-setup-guide.md).

# Envio Indexer Setup Guide

Follow these steps to set up and run the Envio Indexer for querying the orderbook:

### Step 1: Install Docker

Make sure Docker is installed on your machine. You can download and install Docker from [Docker's official website](https://docs.docker.com/engine/install/) for your operating system.

### Step 2: Clone the Envio Indexer Repository

Open your terminal and clone the [spark-envio-indexer](https://github.com/compolabs/spark-envio-indexer) repository using the following command:

```bash
git clone git@github.com:compolabs/spark-envio-indexer.git
```

### Step 3: Set Up the Project

Navigate to the cloned repository and install the necessary dependencies.

```bash
cd spark-envio-indexer
```

```bash
pnpm i
```

Make sure you are using **Node.js version 20**. If needed, you can switch versions using a version manager like `nvm`:

```bash
nvm install 20
nvm use 20
```

### Step 4: Run the Envio Indexer

```bash
pnpm dev
```

Once it's running, verify that the service is working correctly by opening your browser and navigating to: [http://localhost:8080](http://localhost:8080/)

### Step 5: Run a sample Query of the Orderbook

To test the orderbook indexer, you can run a sample query. For example, to retrieve active buy orders, you can use the following query:

```graphql
query ActiveBuyQuery {
  ActiveBuyOrder {
    price
  }
}
```

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.v12.trade/build/getting-started-as-a-developer/data-indexing/envio-indexer-setup-guide.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
