> Source: https://docs.logos.co/lez/follow-chain/run-lez-indexer
> Markdown index of all Logos docs: https://docs.logos.co/llms.txt

# Run an LEZ Indexer

#### Get started with the LEZ Indexer and query finalised LEZ state over HTTP RPC.

> **Tip: Version**
>
> This document is accurate for **Testnet v0.3.0**.

The [LEZ](https://docs.logos.co/get-started/glossary.md#lez) Indexer is a service that reads the finalised LEZ state from the [Logos Blockchain](https://docs.logos.co/get-started/glossary.md#logos-blockchain) node and exposes it over an HTTP RPC interface. Any application can use this interface to query blocks, transactions, and [account](https://docs.logos.co/get-started/glossary.md#account) state. This procedure walks you through running an LEZ Indexer locally alongside its dependencies, verifying it is indexing blocks, and querying account state through the RPC.

> **Info: Prerequisites**
>
>
> - A supported OS:
>    - Linux
>    - macOS
> - A local clone of the [LEZ repository](https://github.com/logos-blockchain/logos-execution-zone).
> - An [LEZ CLI wallet](https://docs.logos.co/lez/get-started/run-lez-wallet-via-cli.md) set up and funded.
> - [`just`](https://github.com/casey/just) installed.
> - [Docker](https://docs.docker.com/get-docker/) installed.
> - A running [Logos Blockchain node](https://docs.logos.co/blockchain/get-started/run-blockchain-node-from-cli.md) (if not deploying locally).
> - Port `8779` free on your machine.

## What to expect

- You can query finalised LEZ blockchain state including blocks, transactions, and accounts via HTTP RPC on `http://localhost:8779`.
- You have a running local stack with the Logos Blockchain node, LEZ Sequencer, and LEZ Indexer coordinated through `just` commands.
- You can verify indexer health and confirm it is progressing by calling the `getLastFinalizedBlockId` and `checkHealth` RPC methods.

## Start the LEZ stack and run the indexer

The indexer depends on the Logos Blockchain Node and benefits from an LEZ Sequencer running alongside it. For a local deployment, start each service in its own terminal.

1. In the LEZ repository, run `just clean` to remove any leftover artifacts from previous runs.
1.  Replace the default value of `bedrock_config.addr` in `lez/indexer/service/configs/debug/indexer_config.json` with your Logos Blockchain endpoint and replace the default `channel_id` there with the LEZ's [channel](https://docs.logos.co/get-started/glossary.md#channel) ID. Get the channel ID from the public LEZ sequencer by running:

    ```bash
    curl https://testnet.lez.logos.co/ \
     -H "Content-Type: application/json" \
     -d "{ \
         \"jsonrpc\": \"2.0\", \
         \"method\": \"getChannelId\", \
         \"params\": {}, \
         \"id\": 1 \
     }"
    ```

    For a local deployment, run the following commands in two separate terminal windows:

    ```sh
    # Run node, in terminal 1
    docker compose up logos-blockchain-node-0
    ```

    ```sh
    # Terminal 2
    just run-sequencer
    ```

    - Test configs are located [here for the node](https://github.com/logos-blockchain/logos-execution-zone/tree/main/bedrock) and [here for the sequencer](https://github.com/logos-blockchain/logos-execution-zone/blob/main/lez/sequencer/service/configs/debug/sequencer_config.json).
1.  In a third terminal window, start the LEZ Indexer:

    ```sh
    just run-indexer
    ```

    The indexer serves JSON-RPC over HTTP (and WebSocket) on `http://localhost:8779` by default. At startup, you will see:

    ```
    [2026-06-18T14:21:59Z INFO  indexer_service] Starting Indexer Service RPC server on 0.0.0.0:8779
    [2026-06-18T14:21:59Z INFO  indexer_core] Starting indexer from beginning of channel
    ```

    The indexer then listens for block finalisations.

## Verify the indexer is progressing

1.  Call `getLastFinalizedBlockId` to confirm the indexer is receiving blocks:

    ```sh
    curl -X POST http://localhost:8779 \
      -H "Content-Type: application/json" \
      -d '{"jsonrpc":"2.0","method":"getLastFinalizedBlockId","params":[],"id":1}'
    ```

    You will receive a response similar to:

    ```sh
    {"jsonrpc":"2.0","id":1,"result":15}
    ```

    The `result` value should increase each time you repeat the call.
1.  Run the health check to confirm the indexer can reconstruct the full state from the database:

    ```sh
    curl -X POST http://localhost:8779 \
      -H "Content-Type: application/json" \
      -d '{"jsonrpc":"2.0","method":"checkHealth","params":[],"id":1}'
    ```

    A healthy indexer returns:

    ```sh
    {"jsonrpc":"2.0","id":1,"result":null}
    ```

    > **Info**
    >
    > `checkHealth` reconstructs the full LEZ state from the database and can produce heavy disk usage. Run it sparingly.

## Query account state using the wallet and RPC

1.  In a fourth terminal window, query an account state by calling `getAccount` with the account ID:

    ```sh
    curl -X POST http://localhost:8779 \
      -H "Content-Type: application/json" \
      -d '{"jsonrpc":"2.0","method":"getAccount","params":{"account_id":"2RHZhw9h534Zr3eq2RGhQete2Hh667foECzXPmSkGni2"},"id":1}'
    ```

    You will receive a response similar to:

    ```sh
    {"jsonrpc":"2.0","id":1,"result":{"program_owner":"FeYNA4PVvs1SsSuECrmQNnJqtB1jA6CbVBBSVGos7qcu","balance":20000,"data":"","nonce":1}}
    ```
1. Run `just run-wallet --help` to see all available wallet commands.

## Frequently asked questions

### Why is there a delay between sending a transaction and seeing it in the indexer?

The delay is caused by Logos Blockchain's block finality time. The indexer only processes finalised blocks from the L1 node, so transactions sent through the sequencer are not visible until the corresponding block is finalised. This is expected behaviour.

### How do I change the indexer configuration?

The indexer config used by `just run-indexer` is located at [lez/indexer/service/configs/debug/indexer\_config.json](https://github.com/logos-blockchain/logos-execution-zone/blob/main/lez/indexer/service/configs/debug/indexer_config.json) (a `configs/docker/indexer_config.json` variant is used for the Docker setup). Two fields control connectivity:

- `bedrock_config`—the HTTP address of the Logos Blockchain node.
- `channel_id`—the channel that LEZ Sequencer writes into. This must match the sequencer you are using.
