1 Setup
Claude edited this page 2026-04-03 11:11:02 +01:00

Setup

The explorer runs as a Docker container alongside the Lethean daemon and a PostgreSQL database.

Prerequisites

  • Docker and Docker Compose
  • A running Lethean daemon (letheand) with RPC enabled
  • A PostgreSQL 15+ instance

Docker Compose

Create a docker-compose.yml:

services:
  daemon:
    image: lthn/chain:testnet
    ports:
      - "36941:36941"  # RPC
      - "36942:36942"  # P2P
    volumes:
      - daemon-data:/home/lethean

  postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: explorer
      POSTGRES_USER: explorer
      POSTGRES_PASSWORD: secret
    volumes:
      - pg-data:/var/lib/postgresql/data

  explorer:
    image: lthn/explorer:testnet
    ports:
      - "3335:3335"
    environment:
      API: http://daemon:36941
      FRONTEND_API: http://localhost:3335
      SERVER_PORT: 3335
      AUDITABLE_WALLET_API: ""
      PGHOST: postgres
      PGPORT: 5432
      PGDATABASE: explorer
      PGUSER: explorer
      PGPASSWORD: secret
    depends_on:
      - daemon
      - postgres

volumes:
  daemon-data:
  pg-data:

Running

docker compose up -d

The explorer will be available at http://localhost:3335.

Startup Behaviour

  1. The explorer connects to the daemon RPC at the address specified by API.
  2. It begins syncing block and transaction data into PostgreSQL for fast queries.
  3. The Next.js frontend serves pages using the cached data, falling back to direct RPC calls when needed.
  4. Initial sync may take several minutes depending on chain height.

Health Check

Once running, verify the explorer is connected:

curl http://localhost:3335/api/getinfo

This should return the current daemon info (height, difficulty, etc.). If the daemon is not yet synced, the explorer will show partial data until sync completes.

Production Notes

  • Place the explorer behind Traefik or another reverse proxy for TLS termination.
  • Set FRONTEND_API to the public URL (e.g. https://explorer.lthn.ai) so the browser-side API calls resolve correctly.
  • Use a dedicated PostgreSQL user with limited privileges for the explorer database.
  • The daemon must have RPC enabled on the port specified in API.