Watchers

A watcher is a type of data source that will generate Events based on the action happened to the data source. For on-chain watchers, it creates Event when a related blockchain event is generated from transactions.

Watcher types

Account watcher

An account watcher monitors all activities of a specific EOA address. It will generate events when the account interacts with specified Contract or Token targets.

Timelock watcher

A timelock watcher monitors all activities of a specific timelock contract. It will generate events when timelock queue.

Configuration Parameters

Timelock contracts usually bundles calldata and other arguments to call the underlying contract and emit events (usually called QueueTransaction). While most timelock contracts follow the same standards, some might differ from them.

By default, Lighthouse use following parameter names to detect timelock events:

  • target - The underlying contract address

  • data - Call data

  • eta - The block number when the underlying transaction can be executed

  • delay - The minimum amount of blocks mined after the event is emitted before the underlying transaction can be executed

  • signature - Signature

  • value - Value of ETH sent in the transaction

The name of these values can be changed in Configuration Parameters section.

Contract Event watcher

A contract watcher monitors all activities of a specific contract. It will generate events when blockchain events are emitted.

Create a watcher

  1. Go to Watchers tab

  1. Click Create Watcher

  2. Choose the type of watcher you want to create

  1. Fill in the required information. Watchers will require specifying at least one target. If you don't have any targets, create one first.

To get watcher running and start generating events, create a Sentinel

Simulate a watcher (Beta)

To verify that the watcher is detecting events you intended it to, you can try running watchers against historical events to check the information.

  1. Click Chip icon to open simulation window.

  2. Choose the starting block and ending block to simulate. The range should not be over 10,000 blocks.

  3. Click Get example events. If there are events detected during the period, all detected events will be shown in JSON format. Otherwise, it will show that there are no events found.

FAQ

How do I know what are the ranges for my interested event?

There are multiple ways to look for the range of your interested event. One way to do it is to look throught the block explorer. Go to the target's

Last updated