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 for your operating system.

Step 2: Clone the Envio Indexer Repository

Open your terminal and clone the spark-envio-indexer repository using the following command:

git clone [email protected]:compolabs/spark-envio-indexer.git

Step 3: Set Up the Project

Navigate to the cloned repository and install the necessary dependencies.

cd spark-envio-indexer
pnpm i

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

nvm install 20
nvm use 20

Step 4: Run the Envio Indexer

pnpm dev

Once it's running, verify that the service is working correctly by opening your browser and navigating to: 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:

query ActiveBuyQuery {
  ActiveBuyOrder {
    price
  }
}

Last updated