A watcher is an entity within the bridge, observing the networks to report the bridge-related actions to the guards. Each watcher only observes one special network, creating commitment about the valid user actions. Once enough commitments were created by all watchers, one of them creates the event trigger. Finally, the event triggers will be processed at a higher level by the guards to do the final payments and transmissions. You can read more about the details here.
Watcher uses some other Rosen-related projects to work properly. It uses the scanner to scan the source network for observations and scan the Ergo for the commitments and other related watcher data. It also uses some extractors to extract needed information from scanned blocks by the scanner. Watcher uses observation-extractor and watcher-data-extractor as the extractors assigned to its scanners.
This project is written in node-js using Esnext module and typeorm database. In order to run the project follow these steps.
npm install
npm run start:dev
npm install
npm run start
You can find the project configs here. In this config, you should set what network you're going to observe (set watcher.network) and what's your secret key as the watcher (set ergo.secret).
Note: If you didn't have a secret key, once you start the project, a random secret will be generated; you can use this secret that appears in the logs.
Check our operation documentation here.