Skip to content

Configuration ​

Environment Variables ​

VariableRequiredDefaultDescription
BOT_TOKENYes—Telegram Bot API token from @BotFather
DATABASE_URLYes—PostgreSQL connection string
POSTGRES_PASSWORDYes—PostgreSQL password (used by Docker Compose)
REDIS_URLYesredis://localhost:6379Redis connection URL
REDIS_PASSWORDNo—Redis password (Docker Compose auto-builds REDIS_URL)
BOT_OWNER_IDNo0Telegram user ID for owner-only commands like /broadcast
ZENON_NODE_HTTPNohttps://node.zenonhub.io:35997Zenon HTTP endpoint
ZENON_NODE_WSNowss://node.zenonhub.io:35998Zenon WebSocket endpoint
ZENON_MNEMONICNo—Bot wallet mnemonic for /zsend and /zfuse
HEALTH_PORTNo0HTTP health check port (0 = disabled)
LOG_LEVELNoinfoLog level: trace, debug, info, warn, error
NODE_ENVNodevelopmentEnvironment mode

Docker Compose ​

The easiest way to run the bot with all dependencies:

bash
cp .env.example .env
# Edit .env with your BOT_TOKEN and POSTGRES_PASSWORD

docker compose up -d

This starts PostgreSQL, Redis, and the bot. The bot waits for both services to be healthy before starting.

Redis Authentication ​

Redis password is optional. Set REDIS_PASSWORD in .env to enable it — Docker Compose automatically constructs the REDIS_URL with credentials.

Manual Setup ​

bash
npm ci
npx prisma generate
npx prisma db push
npm run dev    # development with hot reload
npm run build  # production build
npm start      # run production

Health Check ​

Set HEALTH_PORT to a non-zero port number to enable an HTTP health check endpoint at GET /health. Useful for container orchestration and monitoring.