Docker Installation

This is the fastest and easiest way to get started using Lantern.

Docker Installation

You will need to have Docker installed. Just run:

Shell
docker pull ghcr.io/alphabatem/lantern-release:latest
Shell
docker run -d --name lantern -p 8080:8080 -p 8090:8090 ghcr.io/alphabatem/lantern-release:latest

Web Configuration Tool

On startup, if there is no configuration file created, Lantern will launch a web configuration tool. Point a web browser to the URL provided. It will guide you through creating your first configuration file.

Once you are happy with the config file, select "Save and Run".

See the Web Configuration Tool section for more information.

Editing Docker-Compose

If you want to change the port Lantern serves requests on, you need to edit both the Docker Compose file and set it in the config. Here is a sample Docker Compose file for Lantern:

docker-compose.yml
YAML
services:
  lantern:
    image: ghcr.io/alphabatem/lantern-release:latest
    restart: unless-stopped
    pull_policy: always
    ports:
      - "8080:8080"
      - "8080:8090"
    volumes:
      - lantern-data:/app/data
    networks:
      - lantern-network

networks:
  lantern-network:
    driver: bridge
volumes:
  lantern-data:
    driver: local

Note

If you wish to change the default directory for Lantern's config file, you'll need to add something like this to the Docker Compose file:

YOUR_MOUNTED_PLACE:/app/config.json # <-- add this line to docker compose volume config

Using Lantern

Once Lantern finishes startup, you can start making requests. Requests made before startup finishes will just be forwarded to FluxRPC — Lantern will never risk responding with out-of-date information.

Generally, interesting requests to make are:

getAccountInfogetMultipleAccountsgetBalancegetProgramAccounts

If you make these requests to Lantern for accounts owned by a program you've defined in the config file, it will respond from cache instead of sending the request to the RPC. In this case, Lantern will respond very quickly . The exact speed depends on your computer, but during testing, 100-200 microseconds was pretty typical.

Note

Lantern will need to be able to receive inbound traffic on port 8080, 8081 and 8090, and send outbound traffic to the Internet on ports 443, 8080 and 8081.