admin
.uverse.addressadmin is the only address allowed to write. Deliberately a constant and not transferable ownership: this realm is one person's profile page, and the same address is the only one the chain lets redeploy it.
Value
<gnolang.StringValue>
layoutSlug
untyped stringlayoutSlug names the slot used as the page template.
Value
"layout"
realmPath
untyped stringrealmPath is this realm's own path. Written out rather than read from unsafe.CurrentRealm() because it is also the interface with gnoweb (see the package doc): the constant is the thing that must not drift, so it is stated once and every other use points here.
Value
"gno.land/r/moul/home"
maxSlugLen
untyped bigintmaxSlugLen bounds a slug so an index row stays readable and a key stays cheap.
Value
(64 <untyped> bigint)
slots
*v0.Tree// slug -> \*slot
- OID
- 0517a5…9759:254
slots details
rev
int// total number of writes, bumped by every mutation
Value
14
slot
typeValue
home.slot
reservedSlugs
[]stringreservedSlugs are placeholder names computed at render time from chain state. A slot may not take one, because it would shadow the computed value and make the page depend on callback registration order. The scan.\* half comes from scan.gno's scanPlaceholders and the :reactions: one from reactions.gno, so adding a placeholder in either file reserves it here and cannot be forgotten.
- OID
- 0517a5…9759:258
reservedSlugs details
assertAdmin
func()- OID
- 0517a5…9759:259
assertAdmin details
validSlug
func(slug string) boolvalidSlug reports whether slug is a legal slot name: 1..maxSlugLen bytes of \[a-z0-9.\_-]. The character set excludes ':' so a slug can never break out of its own :slug: placeholder, and excludes uppercase so a slot has one name.
- OID
- 0517a5…9759:261
validSlug details
assertWritableSlug
func(slug string)- OID
- 0517a5…9759:262
assertWritableSlug details
Set
func(slug string, body string)Set creates or replaces the slot named slug. This is the ordinary update: one slot, one transaction. Passing the empty body keeps the slot but empties it; use Delete to remove it.
- OID
- 0517a5…9759:263
Set details
Append
func(slug string, body string)Append adds to the end of a slot, creating it when absent. It exists for content too large to fit in one transaction: Set the first chunk, Append the rest. Ordinary updates should use Set, which is idempotent.
- OID
- 0517a5…9759:264
Append details
Delete
func(slug string)Delete removes a slot. Deleting the layout slot restores the built-in default layout.
- OID
- 0517a5…9759:265
Delete details
Get
func(slug string) stringGet returns a slot body, or "" when the slot does not exist.
- OID
- 0517a5…9759:266
Get details
Revision
func() intRevision returns the total number of writes this realm has accepted. It changes on every mutation, so a client can cheaply tell "nothing moved".
- OID
- 0517a5…9759:267
Revision details
Manifest
func() stringManifest returns one tab-separated line per slot: <slug>\t<rev>\t<len>\t<sha256 of body, hex> It is the diff surface tools/gnohome queries with vm/qeval: one read tells it exactly which local file is out of date, without downloading any body.
- OID
- 0517a5…9759:268
Manifest details
reactionsPlaceholders
[]stringreactionsPlaceholders are the reserved slugs this file answers for. Listed in reservedSlugs (home.gno) so a slot can never take one of these names and shadow the computed value.
- OID
- 0517a5…9759:270
reactionsPlaceholders details
registerReactionCallbacks
func(r *v0.Replacer)registerReactionCallbacks adds the reaction placeholder to r. dynreplacer only invokes a callback whose placeholder actually occurs in the layout, so a layout that does not use :reactions: never calls into the reactions realm at all. RenderBlockFor is used rather than the zero-argument RenderBlock, for the same reason config.TopBlockFor is (see render.gno): the zero-argument form reads the caller off the stack, which would be correct here, but this realm already states its own path as a constant and passing it cannot be wrong.
- OID
- 0517a5…9759:271
registerReactionCallbacks details
defaultLayout
untyped stringdefaultLayout is what renders before a layout slot exists, which is not only the very first deploy: a redeploy re-runs init() and wipes every slot, so this is also the page at the exact moment someone is restoring it. It uses only computed placeholders, so it never shows an unresolved :slug: of its own. It prints no gnokey command and no gas numbers, on purpose. The one it used to print offered 1000000ugnot against 20000000 gas: a ratio of 0.05 against a mainnet floor of 0.001, and gas\_fee is deducted in full as offered and never refunded, so it asked for about fifty times what the write costs. The tooling was corrected and this string was not, which is the argument against having it at all. A command baked into a realm cannot be fixed without a redeploy, and the redeploy is the thing that wipes the slots. gnohome recomputes it from content/ and from the chain, so it cannot go stale.
Value
"# gno.land/r/moul/home\n\nNo layout slot yet. A redeploy wipes every slot and `content/` is the source\nof truth, so push them back with the tool rather than by hand:\n\n go -C tools tool gnohome tx -all\n\nNo gas numbers here on purpose: a command written int"...
chainHeight
func() int64- OID
- 0517a5…9759:273
chainHeight details
Render
func(path string) stringRender serves three views: "" the assembled page, what https://gno.land/u/moul shows "slots" the slot index: name, size, revision, last write "slots/<slug>" one slot's raw markdown, fenced
- OID
- 0517a5…9759:275
Render details
renderPage
func() stringrenderPage fills the layout. dynreplacer only invokes the callbacks whose placeholder actually occurs in the layout, so an unused slot is never even read out of the tree.
- OID
- 0517a5…9759:276
renderPage details
slotLinks
func() stringslotLinks is the :slots: placeholder: a bullet list of every slot, linking to its raw view.
- OID
- 0517a5…9759:277
slotLinks details
renderIndex
func() string- OID
- 0517a5…9759:278
renderIndex details
renderSlot
func(slug string) string- OID
- 0517a5…9759:279
renderSlot details
scanPlaceholders
[]stringscanPlaceholders are the reserved slugs this file answers for. They are listed in reservedSlugs (home.gno) so a slot can never take one of these names and shadow the computed value.
- OID
- 0517a5…9759:281
scanPlaceholders details
scanner
func() v0.Scannerscanner returns the configured link builder. config.Scanner() is a read, and a cheap one: an avl lookup plus a struct. It is called once per render and the result reused, rather than once per placeholder, because dynreplacer may invoke several of the callbacks below and each would otherwise repeat the cross-realm call.
- OID
- 0517a5…9759:282
scanner details
registerScanCallbacks
func(r *v0.Replacer)registerScanCallbacks adds the explorer placeholders to r. dynreplacer only invokes a callback whose placeholder actually occurs in the layout, so a layout using none of these costs one config.Scanner() call and nothing else.
- OID
- 0517a5…9759:284
registerScanCallbacks details
scanLinks
func(s v0.Scanner) stringscanLinks is the :scan.links: placeholder: everything above on one line, for a layout that wants the footer and does not want to lay it out by hand.
- OID
- 0517a5…9759:285