Watch
typeWatch is one registered monitoring target.
Value
realmwatch.Watch
Entry
typeEntry is one append-only log record. Entries are never edited or deleted; Seq is monotone for the life of the realm.
Value
realmwatch.Entry
owner
.uverse.addressValue
<gnolang.StringValue>
agent
.uverse.addressValue
<gnolang.StringValue>
stopped
bool// STOPPED at birth: the owner must explicitly arm it.
Value
false
capPerEpoch
uint64Value
12
epochLen
int64// blocks per epoch window
Value
100
epochStart
int64Value
1502376
epochUsed
uint64Value
0
watchList
[]*realmwatch.Watch- OID
- 0545e9…9668:51
watchList details
entries
[]realmwatch.Entry- OID
- 0545e9…9668:81
entries details
seq
uint64Value
7
maxSummaryLn
int// one line, tweet-sized; keeps the log readable
Value
280
init.13
func()- OID
- 0545e9…9668:14
init.13 details
ClaimOwnership
func()ClaimOwnership sets the owner when the deploy-time capture was empty. It can only ever succeed once, and only while no owner is set; the deployer calls it immediately after addpkg.
- OID
- 0545e9…9668:16
ClaimOwnership details
callerOf
func() .uverse.address- OID
- 0545e9…9668:17
callerOf details
assertOwner
func()- OID
- 0545e9…9668:18
assertOwner details
assertAgent
func()- OID
- 0545e9…9668:19
assertAgent details
rollEpoch
func()rollEpoch advances the cap window if the current one has expired. Called before every gated action.
- OID
- 0545e9…9668:20
rollEpoch details
remaining
func() uint64remaining computes the actions left in the current window without mutating state (safe for view calls).
- OID
- 0545e9…9668:21
remaining details
findWatch
func(id string) *realmwatch.Watch- OID
- 0545e9…9668:22
findWatch details
validKind
func(k string) bool- OID
- 0545e9…9668:23
validKind details
validEntryKind
func(k string) bool- OID
- 0545e9…9668:24
validEntryKind details
validSeverity
func(s string) bool- OID
- 0545e9…9668:25
validSeverity details
SetAgent
func(addr .uverse.address)SetAgent registers (or replaces) the agent address allowed to post.
- OID
- 0545e9…9668:26
SetAgent details
AddWatch
func(id string, kind string, target string, note string)AddWatch registers a new watch target. Owner only.
- OID
- 0545e9…9668:27
AddWatch details
SetWatchActive
func(id string, active bool)SetWatchActive pauses or resumes a single watch without deleting it. A paused watch rejects agent posts. Owner only.
- OID
- 0545e9…9668:28
SetWatchActive details
SetCap
func(cap uint64, epochLenBlocks int64)SetCap sets the per-epoch action cap and the epoch length in blocks. Changing the cap restarts the current window. Owner only.
- OID
- 0545e9…9668:29
SetCap details
SetStopped
func(stop bool)SetStopped is the kill switch. Owner only. While stopped, every agent post reverts on-chain.
- OID
- 0545e9…9668:30
SetStopped details
TripStop
func()TripStop lets the agent arrest itself: if the agent concludes it is compromised or confused, it can halt itself without waiting for the owner. Only the owner can clear the stop afterwards.
- OID
- 0545e9…9668:31
TripStop details
PostAlert
func(kind string, severity string, watchID string, summary string) stringPostAlert appends one entry to the log. This is the agent's ONLY write action, and the realm gates it four ways: 1. caller must be the registered agent, calling directly, 2. STOP must be clear, 3. the named watch must exist and be active, 4. the per-epoch cap must not be exhausted. Any violation panics, the transaction reverts, and nothing is written. Returns the sequence number of the new entry.
- OID
- 0545e9…9668:32
PostAlert details
Owner
func() string- OID
- 0545e9…9668:33
Owner details
Agent
func() string- OID
- 0545e9…9668:34
Agent details
IsStopped
func() bool- OID
- 0545e9…9668:35
IsStopped details
CapPerEpoch
func() uint64- OID
- 0545e9…9668:36
CapPerEpoch details
EpochUsed
func() uint64- OID
- 0545e9…9668:37
EpochUsed details
RemainingActions
func() uint64- OID
- 0545e9…9668:38
RemainingActions details
WatchCount
func() int- OID
- 0545e9…9668:39
WatchCount details
LogCount
func() uint64- OID
- 0545e9…9668:40
LogCount details
WatchIDs
func() stringWatchIDs returns the registered watch ids, comma-separated, in registration order (active and paused).
- OID
- 0545e9…9668:41
WatchIDs details
WatchTarget
func(id string) stringWatchTarget returns "kind|target|active" for one watch, or "".
- OID
- 0545e9…9668:42
WatchTarget details
EntryAt
func(seqNo uint64) stringEntryAt returns one log entry as "seq|height|kind|severity|watchID|summary", or "" if out of range. seqNo is 1-based, matching Entry.Seq.
- OID
- 0545e9…9668:43
EntryAt details
Render
func(path string) string- OID
- 0545e9…9668:44