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 package

Overview

RealmWatch — the on-chain leash for an autonomous agent.

An off-chain agent watches things and posts alerts. This realm is its public control and audit layer:

  • a registry of what the agent is allowed to watch,
  • an append-only log of everything the agent did,
  • a STOP flag and a per-epoch action cap that the REALM enforces.

The point: the cap and the kill switch do not live in the agent's code, where a bug (or a prompt injection) could talk the agent out of them. They live here, in the chain's state. A PostAlert that arrives while STOP is set, or after the epoch cap is spent, reverts. The agent cannot sweet-talk a smart contract.

Trust model:

  • The owner (deployer) configures: agent address, watches, cap, STOP. Only the owner can change configuration.
  • The registered agent address — and only it — can append log entries, and only within the cap and only while not stopped.
  • The agent may trip STOP itself (self-arrest), but only the owner can clear it.
  • All privileged entry points require a direct user call (maketx call from the EOA), never a realm-to-realm call, so caller identity cannot be laundered through another contract.

Functions

AddWatch

func AddWatch(cur realm, id string, kind string, target string, note string)
Ask AI Claude ChatGPT

AddWatch registers a new watch target. Owner only.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch" -func "AddWatch" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch" -func "AddWatch" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Agent

func Agent() string
Ask AI Claude ChatGPT

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch.Agent()"

Result

CapPerEpoch

func CapPerEpoch() uint64
Ask AI Claude ChatGPT

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch.CapPerEpoch()"

Result

ClaimOwnership

func ClaimOwnership(cur realm)
Ask AI Claude ChatGPT

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.

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch" -func "ClaimOwnership" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch" -func "ClaimOwnership" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

EntryAt

func EntryAt(seqNo uint64) string
Ask AI Claude ChatGPT

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

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch.EntryAt()"

Result

EpochUsed

func EpochUsed() uint64
Ask AI Claude ChatGPT

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch.EpochUsed()"

Result

IsStopped

func IsStopped() bool
Ask AI Claude ChatGPT

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch.IsStopped()"

Result

LogCount

func LogCount() uint64
Ask AI Claude ChatGPT

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch.LogCount()"

Result

Owner

func Owner() string
Ask AI Claude ChatGPT

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch.Owner()"

Result

PostAlert

func PostAlert(cur realm, kind string, severity string, watchID string, summary string) string
Ask AI Claude ChatGPT

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.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch" -func "PostAlert" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch" -func "PostAlert" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

RemainingActions

func RemainingActions() uint64
Ask AI Claude ChatGPT

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch.RemainingActions()"

Result

Render

func Render(path string) string
Ask AI Claude ChatGPT

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch.Render()"

Result

SetAgent

func SetAgent(cur realm, addr address)
Ask AI Claude ChatGPT

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

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch" -func "SetAgent" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch" -func "SetAgent" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

SetCap

func SetCap(cur realm, cap uint64, epochLenBlocks int64)
Ask AI Claude ChatGPT

SetCap sets the per-epoch action cap and the epoch length in blocks. Changing the cap restarts the current window. Owner only.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch" -func "SetCap" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch" -func "SetCap" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

SetStopped

func SetStopped(cur realm, stop bool)
Ask AI Claude ChatGPT

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

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch" -func "SetStopped" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch" -func "SetStopped" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

SetWatchActive

func SetWatchActive(cur realm, id string, active bool)
Ask AI Claude ChatGPT

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

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch" -func "SetWatchActive" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch" -func "SetWatchActive" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

TripStop

func TripStop(cur realm)
Ask AI Claude ChatGPT

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.

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch" -func "TripStop" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch" -func "TripStop" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

WatchCount

func WatchCount() int
Ask AI Claude ChatGPT

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch.WatchCount()"

Result

WatchIDs

func WatchIDs() string
Ask AI Claude ChatGPT

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

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch.WatchIDs()"

Result

WatchTarget

func WatchTarget(id string) string
Ask AI Claude ChatGPT

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

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch.WatchTarget()"

Result

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/g15gz99k0zsv59wgvyv5ulxzv5f2dkyzvh0zhaga/realmwatch, for example a function call with arguments.