1
Configuration
Claude edited this page 2026-04-03 11:11:02 +01:00
Configuration
All configuration is done through environment variables. There are no config files.
Core Variables
| Variable | Description | Default | Required |
|---|---|---|---|
API |
Daemon RPC URL. The explorer calls this to fetch blocks, transactions, and network info. | http://127.0.0.1:36941 |
Yes |
FRONTEND_API |
Public URL of the explorer itself. Used by the Next.js frontend for browser-side API requests. Must be reachable from the user's browser. | http://localhost:3335 |
Yes |
SERVER_PORT |
Port the explorer listens on. | 3335 |
No |
AUDITABLE_WALLET_API |
URL for the auditable wallet RPC. Leave empty to disable wallet features. | "" |
No |
PostgreSQL Variables
The explorer uses standard libpq environment variables for database connection.
| Variable | Description | Default | Required |
|---|---|---|---|
PGHOST |
PostgreSQL hostname. | 127.0.0.1 |
Yes |
PGPORT |
PostgreSQL port. | 5432 |
No |
PGDATABASE |
Database name. Must exist before the explorer starts. | explorer |
Yes |
PGUSER |
Database user. | explorer |
Yes |
PGPASSWORD |
Database password. | — | Yes |
Examples
Minimal (local development)
export API=http://127.0.0.1:36941
export FRONTEND_API=http://localhost:3335
export PGHOST=127.0.0.1
export PGDATABASE=explorer
export PGUSER=explorer
export PGPASSWORD=devpassword
Production (behind reverse proxy)
export API=http://daemon:36941
export FRONTEND_API=https://explorer.lthn.ai
export SERVER_PORT=3335
export AUDITABLE_WALLET_API=http://wallet:36660
export PGHOST=postgres.internal
export PGPORT=5432
export PGDATABASE=explorer_prod
export PGUSER=explorer_ro
export PGPASSWORD=strong-random-password
Docker run
docker run -d \
--name explorer \
-p 3335:3335 \
-e API=http://daemon:36941 \
-e FRONTEND_API=http://localhost:3335 \
-e SERVER_PORT=3335 \
-e PGHOST=postgres \
-e PGPORT=5432 \
-e PGDATABASE=explorer \
-e PGUSER=explorer \
-e PGPASSWORD=secret \
lthn/explorer:testnet
Notes
FRONTEND_APIis critical for production. If set incorrectly, the browser will fail to load data because API requests will be sent to the wrong host.- The database schema is managed by the explorer automatically. No manual migrations are needed.
- The daemon at
APImust have RPC enabled and accessible from the explorer container. AUDITABLE_WALLET_APIis optional and only needed if you want to expose wallet balance features.