Watcher Operator Guide
Watcher nodes are registered observers whose daemons can independently probe service endpoints and submit signed votes to Stellar Soroban. The current GREEN Testnet committee uses three project-controlled identities.
Node Requirements
To operate a watcher node reliably:
- Compute: 1 vCPU, 1 GB RAM (minimal footprint).
- Runtime: Go 1.25.0 or later in the supported Go 1.25 toolchain series, or Docker. The module pins the Go 1.25.14 toolchain.
- Network: Stable, unmetered egress connectivity to public internet and Stellar RPC.
- Stellar Account: A dedicated keypair with a modest XLM balance on Testnet to pay transaction fees.
1. Keypair Generation & Registration
- Generate a dedicated Stellar keypair for the watcher node using
stellar-clior Stellar Laboratory. - Fund the public key using Stellar Friendbot.
- Submit the public address (
G...) to the SLASettle registry administrator for inclusion viawatcher_registry.register_watcher(admin, watcher_address). - Verify registration on-chain:bash
stellar contract invoke \ --id CDTIVQ6I77EMFP42522RIFKMSMJID3BDLNR5LPLJEGVAS4Q2DJDMN3DY \ --source <ANY_ACCOUNT> \ --network testnet \ -- is_watcher --watcher <WATCHER_PUBLIC_KEY>
2. Configuring the Watcher Daemon
The Go watcher daemon is located in watcher. It reads process environment variables and does not automatically load .env files. Export the values in the shell or supervisor that launches it. If you store them in .env, source the file with export enabled before starting the daemon (for example, set -a; . ./.env; set +a). Quote NETWORK_PASSPHRASE because it contains spaces and a semicolon.
# Network & RPC
export NETWORK_PASSPHRASE="Test SDF Network ; September 2015"
export RPC_URL="https://soroban-testnet.stellar.org"
# Contract Addresses
export WATCHER_REGISTRY_CONTRACT_ID="CDTIVQ6I77EMFP42522RIFKMSMJID3BDLNR5LPLJEGVAS4Q2DJDMN3DY"
export SLA_VAULT_CONTRACT_ID="CA5R7V5IGMYOBRSAMP4R5MWURSNTY6565NSKEEVR6626PLC3VM2A3EZ2"
# Watcher Identity & Signing Key
export WATCHER_SECRET_KEY="S..."
# Monitored Agreement Configuration
export SLA_ID=2
export TARGET_URL="https://api.example.com/health"
export ROUND_LENGTH_SECONDS=60
export HTTP_TIMEOUT_SECONDS=10
export HTTP_EXPECT_MAX_STATUS=4003. Running the Daemon
From the repository root, run the package in the current watcher/cmd/watcher entrypoint:
cd watcher
go run ./cmd/watcherOperational Loop
Each cycle, the daemon:
- Reads the ledger-derived current round from
watcher_registry. - Queries
has_watcher_votedonwatcher_registry. If already voted, it skips to the next cycle. - Performs one HTTP GET request to
TARGET_URL, bounded byHTTP_TIMEOUT_SECONDS(10 seconds by default). - Votes
UPwhen the response status code is belowHTTP_EXPECT_MAX_STATUS(400 by default). - Votes
DOWNwhen the status code is at or above the threshold, or when the request times out or fails. - Response-body content and latency are not used to classify the result.
- Constructs and signs a
submit_checktransaction on Stellar. - Submits to Soroban RPC and waits for ledger confirmation.
4. Best Practices for High Availability
- Run as a System Service: Deploy using
systemdor Docker withrestart: always. - Alert on Low Balance: Ensure the watcher account retains at least 5 XLM to cover ongoing transaction submission fees.
- Log Aggregation: Monitor stdout logs for network timeouts, RPC rate limits, and confirmed transaction hashes.