Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

realmwatch state

Back to all declarations

Watch

type

Watch is one registered monitoring target.

Value

realmwatch.Watch

Entry

type

Entry 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.address

Value

<gnolang.StringValue>

agent

.uverse.address

Value

<gnolang.StringValue>

stopped

bool

// STOPPED at birth: the owner must explicitly arm it.

Value

false

capPerEpoch

uint64

Value

12

epochLen

int64

// blocks per epoch window

Value

100

epochStart

int64

Value

1502376

epochUsed

uint64

Value

0

seq

uint64

Value

7

maxSummaryLn

int

// one line, tweet-sized; keeps the log readable

Value

280

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.

Open
OID
0545e9…9668:16
ClaimOwnership details

Inspect func

rollEpoch

func()

rollEpoch advances the cap window if the current one has expired. Called before every gated action.

Open
OID
0545e9…9668:20
rollEpoch details

Inspect func

remaining

func() uint64

remaining computes the actions left in the current window without mutating state (safe for view calls).

Open
OID
0545e9…9668:21
remaining details

Inspect func

findWatch

func(id string) *realmwatch.Watch
Open
OID
0545e9…9668:22
findWatch details

Inspect func

validEntryKind

func(k string) bool
Open
OID
0545e9…9668:24
validEntryKind details

Inspect func

validSeverity

func(s string) bool
Open
OID
0545e9…9668:25
validSeverity details

Inspect func

SetAgent

func(addr .uverse.address)

SetAgent registers (or replaces) the agent address allowed to post.

Open
OID
0545e9…9668:26
SetAgent details

Inspect func

AddWatch

func(id string, kind string, target string, note string)

AddWatch registers a new watch target. Owner only.

Open
OID
0545e9…9668:27
AddWatch details

Inspect func

SetWatchActive

func(id string, active bool)

SetWatchActive pauses or resumes a single watch without deleting it. A paused watch rejects agent posts. Owner only.

Open
OID
0545e9…9668:28
SetWatchActive details

Inspect func

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.

Open
OID
0545e9…9668:29
SetCap details

Inspect func

SetStopped

func(stop bool)

SetStopped is the kill switch. Owner only. While stopped, every agent post reverts on-chain.

Open
OID
0545e9…9668:30
SetStopped details

Inspect func

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.

Open
OID
0545e9…9668:31
TripStop details

Inspect func

PostAlert

func(kind string, severity string, watchID string, summary string) string

PostAlert 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.

Open
OID
0545e9…9668:32
PostAlert details

Inspect func

RemainingActions

func() uint64
Open
OID
0545e9…9668:38
RemainingActions details

Inspect func

WatchIDs

func() string

WatchIDs returns the registered watch ids, comma-separated, in registration order (active and paused).

Open
OID
0545e9…9668:41
WatchIDs details

Inspect func

WatchTarget

func(id string) string

WatchTarget returns "kind|target|active" for one watch, or "".

Open
OID
0545e9…9668:42
WatchTarget details

Inspect func

EntryAt

func(seqNo uint64) string

EntryAt returns one log entry as "seq|height|kind|severity|watchID|summary", or "" if out of range. seqNo is 1-based, matching Entry.Seq.

Open
OID
0545e9…9668:43
EntryAt details

Inspect func
Watch : type =realmwatch.Watch
Entry : type =realmwatch.Entry
owner : .uverse.address =<gnolang.StringValue>
agent : .uverse.address =<gnolang.StringValue>
stopped : bool =false
capPerEpoch : uint64 =12
epochLen : int64 =100
epochStart : int64 =1502376
epochUsed : uint64 =0
watchList : []*realmwatch.Watch (len=3) Inspect
entries : []realmwatch.Entry (len=7) Inspect
seq : uint64 =7
maxSummaryLn : int =280
init.13 : func() Inspect
ClaimOwnership : func() Inspect
callerOf : func() .uverse.address Inspect
assertOwner : func() Inspect
assertAgent : func() Inspect
rollEpoch : func() Inspect
remaining : func() uint64 Inspect
findWatch : func(id string) *realmwatch.Watch Inspect
validKind : func(k string) bool Inspect
validEntryKind : func(k string) bool Inspect
validSeverity : func(s string) bool Inspect
SetAgent : func(addr .uverse.address) Inspect
AddWatch : func(id string, kind string, target string, note string) Inspect
SetWatchActive : func(id string, active bool) Inspect
SetCap : func(cap uint64, epochLenBlocks int64) Inspect
SetStopped : func(stop bool) Inspect
TripStop : func() Inspect
PostAlert : func(kind string, severity string, watchID string, summary string) string Inspect
Owner : func() string Inspect
Agent : func() string Inspect
IsStopped : func() bool Inspect
CapPerEpoch : func() uint64 Inspect
EpochUsed : func() uint64 Inspect
RemainingActions : func() uint64 Inspect
WatchCount : func() int Inspect
LogCount : func() uint64 Inspect
WatchIDs : func() string Inspect
WatchTarget : func(id string) string Inspect
EntryAt : func(seqNo uint64) string Inspect
Render : func(path string) string Inspect