# 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>
