Start here

Deploy Blnk Watch

Deploy Blnk Watch for production using the compiled binary and the start command.

For production deployments, install or build the Watch binary and run it with the start command. This gives you the standard long-running Watch process: the HTTP service starts, and when DB_URL is set, Watch also runs continuous Core sync in the same process.

Standard deployment

Use direct download to fetch and install the Watch binary on your system. No Git or Go is required for the binary itself.

Install Watch

Install the Watch binary without cloning the repo or building from source:

curl -fsSL https://blnkfinance.xyz/install/watch | bash

This installs the blnk-watch binary on your machine.

Set environment variables

Set the environment variables Watch needs:

# PostgreSQL database connection string
DB_URL=postgres://user:password@localhost:5432/blnk?sslmode=disable

# GitHub repo containing your .ws rule files (required when not using a local rules directory)
WATCH_SCRIPT_GIT_REPO=https://github.com/your-org/watch-rules.git
WATCH_SCRIPT_GIT_BRANCH=main

# Private HTTPS repos only
WATCH_SCRIPT_GIT_USERNAME=x-access-token
WATCH_SCRIPT_GIT_TOKEN=

See Configuration for the full list, including Git authentication for private repos.

Start Watch

Run Watch with the start command:

blnk-watch start

Build the Watch binary from the source repository. Use this when you have Go installed and want to compile locally (for example, to pin a version or run from the project directory).

Build the binary

From the Watch project root, build the binary:

go build -o blnk-watch ./cmd/blnk-watch

This produces a blnk-watch binary in the current directory.

Set environment variables

Set the environment variables Watch needs:

DB_URL=postgres://user:password@localhost:5432/blnk?sslmode=disable

See Configuration for the full list.

Start Watch

From the Watch project root, run the binary with the start command:

./blnk-watch -command=start

For PaaS deployments (Railway, Render, Fly.io, etc)

The same deployment steps apply, but you need to attach a persistent volume to the container. Watch stores its data on disk.

However, most PaaS platforms have a temporary disk that is wiped on redeploys. To prevent this, attach a persistent volume mounted at ./blnk_watch_db so that data survives restarts and redeploys.