Skip to content

MostroP2P/mostro-watchdog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

67 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ• mostro-watchdog

CI Release Latest Release License: MIT

mostro-watchdog mascot

Real-time Telegram notification bot for Mostro administrators. Monitors Nostr dispute events (kind 38386) and sends instant alerts to a Telegram group or channel.

Why?

When a user opens a dispute on Mostro, administrators need to respond quickly. Users in disputes are worried β€” fast response times build trust and improve the experience.

mostro-watchdog bridges Nostr and Telegram so admins get notified the instant a dispute is created, without needing to monitor Mostrix or Nostr clients constantly.

How it works

Mostro daemon β†’ Nostr (kind 38386) β†’ mostro-watchdog β†’ Telegram alert
  1. Mostro daemon publishes a dispute event (kind 38386) to Nostr relays
  2. mostro-watchdog subscribes to these events filtered by your Mostro's pubkey
  3. When a new dispute is detected (status: initiated), it sends a formatted alert to your Telegram group/channel
  4. Admins see the alert and can take the dispute via Mostrix or their preferred admin client

Quick Start

Prerequisites

  • Rust (1.75+)
  • A Telegram bot token (from @BotFather)
  • Your Mostro daemon's Nostr public key

Native Build Dependencies

Some Rust crates require native libraries and build tools. Install them before building:

Ubuntu / Debian:

sudo apt update
sudo apt install -y cmake pkg-config libssl-dev

macOS (Homebrew):

brew install cmake openssl pkg-config
export OPENSSL_DIR=$(brew --prefix openssl)

Tip: Add the export OPENSSL_DIR=... line to your ~/.zshrc (or ~/.bashrc) so you don't have to set it every time.

Install

Option 1: Automatic Installation Script (Recommended)

The easiest way to install mostro-watchdog is using our installation script:

# Download and run the installation script
curl -fsSL https://raw.githubusercontent.com/MostroP2P/mostro-watchdog/main/install.sh | bash

# Or for custom installation directory:
curl -fsSL https://raw.githubusercontent.com/MostroP2P/mostro-watchdog/main/install.sh | bash -s -- --install-dir ~/.local/bin

Prefer to inspect before running?

curl -fsSL -o install.sh https://raw.githubusercontent.com/MostroP2P/mostro-watchdog/main/install.sh
less install.sh        # review the script
bash install.sh        # run after inspection

The script will:

  • βœ… Auto-detect your platform (Linux x64/ARM64, macOS Intel/Apple Silicon, Windows via WSL/Git Bash/MSYS2)
  • βœ… Download the latest pre-built binary
  • βœ… Verify checksums for security
  • βœ… Install to /usr/local/bin (or custom directory)
  • βœ… Set executable permissions
  • βœ… Provide next steps guidance

Option 2: Manual Binary Download

Download the latest binary for your platform from the releases page:

Linux:

# x86_64 (Intel/AMD)
curl -LO https://github.com/MostroP2P/mostro-watchdog/releases/latest/download/mostro-watchdog-linux-x86_64
chmod +x mostro-watchdog-linux-x86_64
sudo mv mostro-watchdog-linux-x86_64 /usr/local/bin/mostro-watchdog

# ARM64 (Raspberry Pi, ARM servers)
curl -LO https://github.com/MostroP2P/mostro-watchdog/releases/latest/download/mostro-watchdog-linux-aarch64
chmod +x mostro-watchdog-linux-aarch64
sudo mv mostro-watchdog-linux-aarch64 /usr/local/bin/mostro-watchdog

macOS:

# Intel Macs
curl -LO https://github.com/MostroP2P/mostro-watchdog/releases/latest/download/mostro-watchdog-macos-x86_64
chmod +x mostro-watchdog-macos-x86_64
sudo mv mostro-watchdog-macos-x86_64 /usr/local/bin/mostro-watchdog

# Apple Silicon (M1/M2/M3)
curl -LO https://github.com/MostroP2P/mostro-watchdog/releases/latest/download/mostro-watchdog-macos-aarch64
chmod +x mostro-watchdog-macos-aarch64
sudo mv mostro-watchdog-macos-aarch64 /usr/local/bin/mostro-watchdog

Windows:

# Download and install to user directory
$UserBin = "$env:USERPROFILE\bin"
New-Item -ItemType Directory -Force -Path $UserBin
Invoke-WebRequest -Uri "https://github.com/MostroP2P/mostro-watchdog/releases/latest/download/mostro-watchdog-windows-x86_64.exe" -OutFile "$UserBin\mostro-watchdog.exe"
# Add $UserBin to your PATH environment variable if not already present

Verify the download (recommended):

# Download checksums
curl -LO https://github.com/MostroP2P/mostro-watchdog/releases/latest/download/manifest.txt

# Verify your binary
# Linux/WSL
sha256sum -c manifest.txt --ignore-missing

# macOS
shasum -a 256 -c manifest.txt

# Windows (PowerShell)
# Manual verification - compare hash from manifest.txt with:
# Get-FileHash .\mostro-watchdog-windows-x86_64.exe -Algorithm SHA256

Option 3: Docker

git clone https://github.com/MostroP2P/mostro-watchdog.git
cd mostro-watchdog
cp config.example.toml config.toml
# Edit config.toml with your settings
docker compose up -d

Pre-built images are available from GitHub Container Registry:

docker pull ghcr.io/mostrop2p/mostro-watchdog:latest
docker run -d --name mostro-watchdog --restart unless-stopped \
  -v $(pwd)/config.toml:/config/config.toml:ro \
  ghcr.io/mostrop2p/mostro-watchdog:latest

See DOCKER.md for full documentation.

Option 4: Build from Source

git clone https://github.com/MostroP2P/mostro-watchdog.git
cd mostro-watchdog
cargo build --release

# Binary will be at ./target/release/mostro-watchdog

Configure

# Copy the example config
cp config.example.toml config.toml

# Edit with your values
nano config.toml

You'll need to set:

  • mostro.pubkey β€” Your Mostro daemon's Nostr public key
  • nostr.relays β€” The relays your Mostro daemon uses
  • telegram.bot_token β€” Token from @BotFather
  • telegram.chat_id β€” The Telegram group/channel ID for alerts

Run

# Default (looks for ./config.toml, then ~/.config/mostro-watchdog/config.toml)
./target/release/mostro-watchdog

# Custom config path
./target/release/mostro-watchdog --config /path/to/config.toml

# Positional argument also works
./target/release/mostro-watchdog /path/to/config.toml

# With debug logging
RUST_LOG=mostro_watchdog=debug ./target/release/mostro-watchdog

# Help & version
./target/release/mostro-watchdog --help
./target/release/mostro-watchdog --version

The config file is searched in this order:

  1. ./config.toml (current directory)
  2. ~/.config/mostro-watchdog/config.toml

Or specify it explicitly with --config / -c.

Setting up the Telegram bot

  1. Open Telegram and message @BotFather
  2. Send /newbot and follow the instructions to create a new bot
  3. Copy the bot token to your config.toml
  4. Create a private group/channel for your admin team
  5. Add the bot to the group/channel
  6. Get the chat ID (see config.example.toml for instructions)

Alert Format

When a dispute is detected, you'll receive a message like:

🚨 NEW DISPUTE

πŸ“‹ Dispute ID: abc123def456
πŸ‘€ Initiated by: buyer
⏰ Time: 2026-02-11 18:30:00 UTC

⚑ Please take this dispute in Mostrix or your admin client.

Configuration Reference

Field Description
mostro.pubkey Mostro daemon's Nostr public key (hex or npub)
nostr.relays Array of Nostr relay WebSocket URLs
telegram.bot_token Telegram bot API token
telegram.chat_id Telegram chat/group/channel ID for alerts

Roadmap

  • Pre-built binaries for Linux, macOS, Windows βœ… Available now with automatic installation script
  • Health check / heartbeat notifications βœ… Configurable monitoring and alerting
  • Alert on dispute status changes βœ… Monitor all dispute lifecycle events
  • Multiple Telegram channels for different event types
  • Docker image

Contributing

Contributions are welcome! Please open an issue first to discuss what you'd like to change.

License

MIT

About

πŸ• Nostr-based notification bot for Mostro administrators. Monitors dispute events and sends real-time Telegram alerts.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors