A comprehensive system for monitoring Steem blockchain operations for tracked accounts, with real-time Telegram notifications and a modern web interface.
- Blockchain Sync Service: Continuously syncs Steem blockchain data from a configured block height to the latest irreversible block
- Account Tracking: Monitor specific Steem accounts for all operations
- Compensator Tool: Fetch historical operations for accounts added after sync has started
- Telegram Notifications: Receive formatted notifications for selected operation types
- REST API: Full-featured API for querying operation history
- Web Interface: Modern React-based UI with pagination and filtering
- Docker Deployment: Single container deployment with supervisord and nginx
The system consists of four main components:
- Sync Service (
cmd/sync): Syncs blockchain data and stores it in MongoDB - Compensator Tool (
cmd/compensator): Fetches historical operations for specific accounts within a block range - API Service (
cmd/api): Provides REST API endpoints for the web frontend - Web Frontend (
web/): React application built with Vite, Tailwind CSS, and shadcn/ui
All services run in a single Docker container managed by supervisord.
Edit configs/config.yaml to configure:
steem:
api_url: "https://api.steem.fans" # Steem API endpoint
start_block: 50000000 # Starting block height
accounts:
- "burndao.burn" # Accounts to track
mongodb:
uri: "mongodb://localhost:27017" # MongoDB connection string
database: "sps_fund_watcher" # Database name
telegram:
enabled: true # Enable Telegram notifications
bot_token: "" # Telegram bot token
channel_id: "" # Telegram channel ID
notify_operations: # Operation types to notify
- "transfer"
- "account_update"
- "account_update2"
# Empty list means notify all operations
api:
port: "8080" # API server port
host: "0.0.0.0" # API server host# Build sync service
go build -o sync ./cmd/sync
# Build API service
go build -o api ./cmd/api
# Build compensator tool
go build -o compensator ./cmd/compensatorcd web
pnpm install
pnpm run devdocker build -t sps-fund-watcher .
docker run -d \
-p 80:80 \
-v $(pwd)/configs/config.yaml:/app/configs/config.yaml \
sps-fund-watcherGET /api/v1/health- Health checkGET /api/v1/accounts- List all tracked accountsGET /api/v1/accounts/:account/operations- Get operations for an account- Query params:
page,page_size,type(optional operation type filter)
- Query params:
GET /api/v1/accounts/:account/transfers- Get transfer operations onlyGET /api/v1/accounts/:account/updates- Get account update operations
The web interface is available at http://localhost (when running in Docker) or http://localhost:5173 (when running pnpm run dev).
Features:
- Account selector (defaults to
burndao.burn) - Operation type filter (All, Transfers, Account Updates)
- Paginated operation table
- Responsive design
The sync service reads configuration from a YAML file. Important: Always use the -config flag when starting the service:
go run cmd/sync/main.go -config configs/config.yamlOr with a custom config file:
go run cmd/sync/main.go -config configs/config.temp.yamlNote: Without the -config flag, the service will use the default config file path.
go run cmd/api/main.go -config configs/config.yamlThe compensator tool is used to fetch historical operations for accounts that were added to tracking after the sync service has already been running. This fills the gap for operations that occurred before the account was added to the tracking list.
Usage:
./compensator -account <account_name> -start <start_block> -end <end_block> <config_file>Example:
./compensator -account burndao.burn -start 101777000 -end 101780000 configs/config.yamlParameters:
-account: The account name to fetch operations for (required)-start: Starting block number (required, must be > 0)-end: Ending block number (required, must be > 0, must be >= start)config_file: Path to configuration file (required, positional argument)
What it does:
- Loads configuration from the specified YAML file
- Connects to Steem API using
steem.api_urlfrom config - Connects to MongoDB using
mongodb.uriandmongodb.databasefrom config - Fetches blocks from
starttoendin batches (usingsteem.batch_sizefrom config) - Extracts and stores all operations for the specified account in that range
- Uses upsert to prevent duplicate operations
Note: The compensator does not update sync state or send Telegram notifications, as it's designed for historical data only.
If you need to restart synchronization from a specific block height, you can clear the sync state:
Option 1: Clear sync state only (keeps existing operations)
docker exec sps-fund-watcher-mongo-temp mongo sps_fund_watcher --eval "db.sync_state.drop(); print('Sync state dropped')" --quietOption 2: Clear entire database (removes all operations and sync state)
docker exec sps-fund-watcher-mongo-temp mongo sps_fund_watcher --eval "db.dropDatabase(); print('Database dropped')" --quietAfter clearing the sync state, restart the sync service with your desired configuration. The service will start from the start_block specified in your config file.
- Go 1.21+
- Node.js 20+
- pnpm (for frontend package management)
- MongoDB
- Docker (for containerized deployment)
sps-fund-watcher/
├── cmd/
│ ├── sync/ # Sync service entry point
│ ├── compensator/ # Compensator tool entry point
│ └── api/ # API service entry point
├── internal/
│ ├── sync/ # Sync service logic
│ ├── api/ # API handlers and routes
│ ├── models/ # Data models
│ ├── storage/ # MongoDB storage layer
│ └── telegram/ # Telegram notification client
├── web/ # Frontend React app
│ ├── src/
│ ├── public/
│ └── package.json
├── configs/
│ ├── config.yaml # Main configuration file
│ ├── supervisord.conf
│ └── nginx.conf
├── Dockerfile
└── README.md
MIT