Testnet only (Arkiv Tiramisu). OpenTrigger 0.1 has not had an outside audit.
OpenTrigger

Worker

startWorker options, the handle it returns, and what a worker does on every tick.

import { startWorker } from 'arkiv-triggers/worker'

const worker = await startWorker(options)

Options

Prop

Type

Handle

MemberWhat it is
addressThe worker's address
sealKeyIts public sealing key (also in its heartbeat)
stats(){ rules, fired, failed, skipped, lastBlock, heartbeat }
tick()Run one pass now (tests)
stop()Finish actions in flight, stop the loop, close the feed

What it does

On start: resume from the lastblock in its previous heartbeat, replay deletes it missed, write a heartbeat, open the event feed. Then, every pollMs:

  1. Reload rules if the feed saw a change and reloadMs has passed (or every 2 × reloadMs regardless).
  2. Compute each open rule's deadline (expire targets are re-read every 10 minutes, every 30 seconds within 10 minutes of the deadline, and always right before firing).
  3. Claim rules due within 8 blocks, settle the claim race, and fire those it won with at least 18 blocks of lease left.
  4. Write receipts, first in the next transaction.

The heartbeat is renewed every heartbeatMs. See Workers and claims.

On this page