Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v1 state

Back to all declarations

KeyBlockTop

untyped string

The notice blocks: two strings a realm drops at the top and the bottom of its Render, empty by default, so moul can put a warning, a changelog line or a bit of news on every realm at once or on one of them. func Render(path string) string { return config.TopBlock() + body + config.BottomBlock() } Both are set with the ordinary Set, which is what keeps this realm's surface from growing a function per idea: Set block.top "> Chain migration on Tuesday." # every realm Set block.top@r/moul/gns "> v2 shipped, see the changelog" # this one only

Value

"block.top"

KeyBlockBottom

untyped string

The notice blocks: two strings a realm drops at the top and the bottom of its Render, empty by default, so moul can put a warning, a changelog line or a bit of news on every realm at once or on one of them. func Render(path string) string { return config.TopBlock() + body + config.BottomBlock() } Both are set with the ordinary Set, which is what keeps this realm's surface from growing a function per idea: Set block.top "> Chain migration on Tuesday." # every realm Set block.top@r/moul/gns "> v2 shipped, see the changelog" # this one only

Value

"block.bottom"

TopBlock

func() string

TopBlock returns the notice for the realm calling in, ready to concatenate in front of its content. Empty when there is nothing to say, which is the default and the usual case. Three things can appear, in this order, separated by blank lines: 1. the pause banner, when this realm or every realm is paused 2. the global block.top 3. this realm's own block.top The pause banner comes first because it is the one a reader has to see, and it is included here rather than left to the realm so that guarding writes with AssertWritable is enough to also explain the refusal on the page. Global and scoped are BOTH shown rather than one overriding the other: a chain-wide warning and a per-realm changelog are different messages, and dropping either because the other exists is the surprising behaviour.

Open
OID
0987bc…a02a:3
TopBlock details

Inspect func

TopBlockFor

func(pkgPath string) string

TopBlockFor is TopBlock for a named realm. Use it from a crossing function, where the caller cannot be read off the stack, or to render another realm's notice.

Open
OID
0987bc…a02a:5
TopBlockFor details

Inspect func

BottomBlock

func() string

BottomBlock returns the notice for the realm calling in, ready to concatenate after its content. No pause banner here: one is enough, and the top is where it is read.

Open
OID
0987bc…a02a:6
BottomBlock details

Inspect func

BottomBlockFor

func(pkgPath string) string

BottomBlockFor is BottomBlock for a named realm.

Open
OID
0987bc…a02a:7
BottomBlockFor details

Inspect func

joinBlocks

func(parts []string) string

joinBlocks assembles the non-empty parts into one markdown fragment. Each part is separated by a blank line, because two markdown blocks with only a newline between them are one paragraph, and a blockquote followed directly by text swallows the text into the quote. The result ends with a blank line when there is anything at all, so a realm can write config.TopBlock() + body without a separator of its own and get the same output whether or not a notice is set. Nothing to say means the empty string, and the page is byte-for-byte what it was before.

Open
OID
0987bc…a02a:8
joinBlocks details

Inspect func

AddManager

func(addr .uverse.address) .uverse.error

AddManager adds a new address to the list of authorized managers. This only works if the current authority is a MemberAuthority. The caller must be authorized by the current authority.

Open
OID
0987bc…a02a:12
AddManager details

Inspect func

RemoveManager

func(addr .uverse.address) .uverse.error

RemoveManager removes an address from the list of authorized managers. This only works if the current authority is a MemberAuthority. The caller must be authorized by the current authority.

Open
OID
0987bc…a02a:13
RemoveManager details

Inspect func

TransferManagement

func(newAuthority v0.Authority) .uverse.error

TransferManagement transfers the authority to manage keys to a new authority. The caller must be authorized by the current authority.

Open
OID
0987bc…a02a:14
TransferManagement details

Inspect func

ListManagers

func() [].uverse.address
Open
OID
0987bc…a02a:15
ListManagers details

Inspect func

HasManager

func(addr .uverse.address) bool
Open
OID
0987bc…a02a:16
HasManager details

Inspect func

ScopeSep

untyped string

The key grammar. A key is a NAME, optionally followed by "@" and a SCOPE: pause applies to every realm that asks pause@r/moul/home applies to that realm only The scope is a package path with the chain domain stripped, because the domain is the same for every realm reading this one and repeating it in a few dozen keys buys nothing but storage. Two settings therefore answer every scoped question, and each reader decides how they combine: pause takes the stricter of the two (pausable.Strictest), while the notice blocks show both. That choice belongs to the reader and not here, because "stricter wins" and "show both" are both right, for different settings.

Value

"@"

maxNameLen

untyped bigint

The key grammar. A key is a NAME, optionally followed by "@" and a SCOPE: pause applies to every realm that asks pause@r/moul/home applies to that realm only The scope is a package path with the chain domain stripped, because the domain is the same for every realm reading this one and repeating it in a few dozen keys buys nothing but storage. Two settings therefore answer every scoped question, and each reader decides how they combine: pause takes the stricter of the two (pausable.Strictest), while the notice blocks show both. That choice belongs to the reader and not here, because "stricter wins" and "show both" are both right, for different settings.

Value

(64 <untyped> bigint)

maxScopeLen

untyped bigint

The key grammar. A key is a NAME, optionally followed by "@" and a SCOPE: pause applies to every realm that asks pause@r/moul/home applies to that realm only The scope is a package path with the chain domain stripped, because the domain is the same for every realm reading this one and repeating it in a few dozen keys buys nothing but storage. Two settings therefore answer every scoped question, and each reader decides how they combine: pause takes the stricter of the two (pausable.Strictest), while the notice blocks show both. That choice belongs to the reader and not here, because "stricter wins" and "show both" are both right, for different settings.

Value

(128 <untyped> bigint)

realmPath

untyped string

realmPath is this realm's own path, including its version. Stated once so the page can link to itself and the proxy check can recognise a sibling version without either restating the string.

Value

"gno.land/r/moul/config/v1"

validName

func(name string) bool

validName reports whether name is a legal setting name: 1..maxNameLen bytes of \[a-z0-9.\_-]. The dot is the namespace separator ("block.top"), lowercase only so a setting has exactly one name, and no whitespace so a name round-trips through Manifest's tab-separated lines.

Open
OID
0987bc…a02a:17
validName details

Inspect func

validScope

func(scope string) bool

validScope reports whether scope is shaped like a package path with the domain stripped: 1..maxScopeLen bytes of [a-z0-9.\_/-](/a-z0-9._/-), no empty segment.

Open
OID
0987bc…a02a:19
validScope details

Inspect func

validKey

func(key string) bool

validKey reports whether key is a legal name, or a legal name and scope joined by ScopeSep.

Open
OID
0987bc…a02a:20
validKey details

Inspect func

SplitKey

func(key string) (name string, scope string)

SplitKey takes a key apart. An unscoped key returns an empty scope, and so does a malformed one: callers pair this with validKey rather than trusting the split.

Open
OID
0987bc…a02a:21
SplitKey details

Inspect func

Scope

func(pkgPath string) string

Scope turns a package path into the scope half of a key, stripping the chain domain: "gno.land/r/moul/home" and "r/moul/home" both give "r/moul/home". A path that is not shaped like one comes back empty, and every caller here treats that as "no scope", falling back to the global setting rather than inventing a key nobody can type. The chain domain is tried first and the literal "gno.land/" second, so a key written on one chain still resolves on another whose domain differs. Twin of mygnoscan.TrimDomain, which answers the same question for a URL and is stricter about the characters, because its output lands inside a link.

Open
OID
0987bc…a02a:22
Scope details

Inspect func

KeyFor

func(name string, pkgPath string) string

KeyFor builds the scoped key for a setting on one realm, and returns the bare name when pkgPath names no realm this can scope to. This is what a realm should render when it wants to tell a manager which setting to change, so the command in the page is the command that works.

Open
OID
0987bc…a02a:23
KeyFor details

Inspect func

caller

func() string

caller is the package path of the realm that called into this one. Every exported function here that uses it is a plain read with no \`cur realm\` parameter, so it can only ever be BORROWED: gno runs it without opening a realm frame, and unsafe.CurrentRealm() therefore reports the borrower. That is what makes the zero-argument helpers (TopBlock, IsPaused, …) able to name their caller at all. Measured in the test harness on 2026-09-22: a call from a code realm at gno.land/r/test/caller reports CurrentRealm=gno.land/r/test/caller and PreviousRealm=gno.land/r/moul/config/v1. The moment one of these grows a \`cur realm\` parameter this stops being true and starts reporting this realm instead. Do not add one. Anything that needs a realm frame takes the path explicitly, which is what the …For variants are.

Open
OID
0987bc…a02a:24
caller details

Inspect func

scopedPair

func(name string, pkgPath string) (global string, scoped string)

scopedPair reads both halves of a scoped setting: the global one and the one for pkgPath, either of which may be empty.

Open
OID
0987bc…a02a:25
scopedPair details

Inspect func

KeyPause

untyped string

The pause switch: one setting that stops every realm reading this one, and one per realm that stops just that one. Set pause "paused: incident, back in an hour" Set pause@r/moul/gns "readonly" Unset pause # running again A realm guards its writes and leaves its reads alone, which is what makes "readonly" the level worth having: the page keeps rendering and explains itself through TopBlock, and nothing new lands. func Post(cur realm, body string) { config.AssertWritable() … } The levels, the fail-closed parse and the stricter-of-two rule all live in gno.land/p/moul/pausable; this file is only the wiring to storage.

Value

"pause"

Pause

func() v0.State

Pause returns the pause state of the realm calling in: the stricter of the global setting and that realm's own.

Open
OID
0987bc…a02a:26
Pause details

Inspect func

PauseFor

func(pkgPath string) v0.State

PauseFor is Pause for a named realm. A stale per-realm entry can never re-open a realm during a global pause, because the two combine with pausable.Strictest rather than one overriding the other. The cost is that exempting one realm from a global pause is not expressible: clear the global and set the others.

Open
OID
0987bc…a02a:28
PauseFor details

Inspect func

IsPaused

func() bool

IsPaused reports whether the realm calling in is held back at all, ReadOnly as well as fully paused.

Open
OID
0987bc…a02a:29
IsPaused details

Inspect func

IsPausedFor

func(pkgPath string) bool

IsPausedFor is IsPaused for a named realm.

Open
OID
0987bc…a02a:30
IsPausedFor details

Inspect func

AssertWritable

func()

AssertWritable aborts unless the realm calling in may still change state. This is the one line a mutating function needs.

Open
OID
0987bc…a02a:31
AssertWritable details

Inspect func

AssertWritableFor

func(pkgPath string)

AssertWritableFor is AssertWritable for a named realm, for a crossing function that cannot be read off the stack.

Open
OID
0987bc…a02a:32
AssertWritableFor details

Inspect func

AssertReadable

func()

AssertReadable aborts unless the realm calling in may still be read. Most realms should NOT put this in Render. A page that aborts tells a reader nothing; TopBlock tells them what happened and when to come back. Reach for this only where serving stale data is itself the harm.

Open
OID
0987bc…a02a:33
AssertReadable details

Inspect func

AssertReadableFor

func(pkgPath string)

AssertReadableFor is AssertReadable for a named realm.

Open
OID
0987bc…a02a:34
AssertReadableFor details

Inspect func

AllowProxy

func(pkgPath string)

AllowProxy registers a newer version of this realm as a relay. Manager only. It takes a package path rather than an address because a path is what a manager can check by eye; the address is derived here with the same function the chain uses, so the two cannot drift.

Open
OID
0987bc…a02a:38
AllowProxy details

Inspect func

RevokeProxy

func(pkgPath string)

RevokeProxy withdraws a relay. Manager only. Revoking one that was never registered aborts rather than passing quietly: at this point in an incident, "done" and "you misspelled it" must not look the same.

Open
OID
0987bc…a02a:40
RevokeProxy details

Inspect func

IsProxy

func(addr .uverse.address) bool

IsProxy reports whether addr is a registered relay.

Open
OID
0987bc…a02a:41
IsProxy details

Inspect func

ListProxies

func() []string

ListProxies returns the registered relay paths, in sorted order.

Open
OID
0987bc…a02a:42
ListProxies details

Inspect func

SetAs

func(principal .uverse.address, key string, value string)

SetAs is Set, performed by a registered proxy on behalf of principal. Two checks, and both have to hold: the caller is a registered relay, and the principal it names is authorized. Neither is redundant. Dropping the first would let any realm claim any principal; dropping the second would make a registered proxy an unconditional bypass of the member list.

Open
OID
0987bc…a02a:43
SetAs details

Inspect func

UnsetAs

func(principal .uverse.address, key string)

UnsetAs is Unset, performed by a registered proxy on behalf of principal.

Open
OID
0987bc…a02a:44
UnsetAs details

Inspect func

assertRelay

func()

assertRelay aborts unless the immediate caller is a registered proxy.

Open
OID
0987bc…a02a:45
assertRelay details

Inspect func

assertPrincipal

func(principal .uverse.address, title string)

assertPrincipal puts an address through the Authorizer without it being the caller, which is what a relay needs and what DoByPrevious cannot express. With the default MemberAuthority this is a membership test. With an authority that inspects the caller instead (a ContractAuthority), the relayed path asks that authority about the principal, so check what it does before transferring management while a proxy is registered.

Open
OID
0987bc…a02a:46
assertPrincipal details

Inspect func

assertProxyPath

func(pkgPath string)

assertProxyPath refuses anything that is not a realm path under this namespace. A proxy is by definition a later version of this realm, so nothing else should ever be registered, and the narrow check turns a fat-fingered AllowProxy into an abort rather than a standing grant to an unrelated realm.

Open
OID
0987bc…a02a:47
assertProxyPath details

Inspect func

KeyMygnoscanURL

untyped string

The keys this realm answers for by name. A key is just a string and any key can be set, but one the rest of the repo reads gets a constant here so the reader and the writer cannot drift apart on a typo.

Value

"mygnoscan.url"

KeyMygnoscanNetwork

untyped string

The keys this realm answers for by name. A key is just a string and any key can be set, but one the rest of the repo reads gets a constant here so the reader and the writer cannot drift apart on a typo.

Value

"mygnoscan.network"

maxValueLen

untyped bigint

maxValueLen bounds one write. Storage is paid for and never refunded, so this realm holds settings, not content: a URL, a flag, a short list. A notice block is the one that pushes against it, and 1024 bytes is several paragraphs of markdown. A realm that needs more than that is asking this one to be a CMS, which is what its own slots are for.

Value

(1024 <untyped> bigint)

setting

type

Value

v1.setting

settingsRev

int

Value

0

Set

func(key string, value string)

Set creates or replaces a setting. Only an address the Authorizer accepts may call it. It panics rather than returning an error, which is the opposite of the manager functions in config.gno, and deliberately so: a returned error from a realm call leaves the transaction SUCCESSFUL. A rejected config write that reports success is the one outcome worth ruling out here, because the caller then walks away believing the new value is live and every realm reading this key keeps serving the old one. The manager functions predate that reasoning and are frozen on chain at v0; new surface does not inherit the mistake.

Open
OID
0987bc…a02a:53
Set details

Inspect func

Unset

func(key string)

Unset removes a setting, so readers fall back to their built-in default. Removing a key that is not set is an error, not a no-op: it almost always means the key was misspelled here or in the realm that reads it.

Open
OID
0987bc…a02a:55
Unset details

Inspect func

writeSetting

func(key string, value string)

writeSetting is the only place a setting is stored, shared by the direct and the relayed path so a new caller cannot forget the revision or the event.

Open
OID
0987bc…a02a:56
writeSetting details

Inspect func

removeSetting

func(key string)

removeSetting is writeSetting's twin.

Open
OID
0987bc…a02a:57
removeSetting details

Inspect func

assertWritableKey

func(key string)
Open
OID
0987bc…a02a:58
assertWritableKey details

Inspect func

assertValue

func(key string, value string)

assertValue rejects a value the reader could not make sense of. Only pause has a grammar today, and it is exactly the setting where a silently unreadable value matters: pausable.MustParse fails CLOSED, so a typo stored here would take every realm offline at the next render. Catching it on the way in costs one comparison and turns that into a failed transaction the writer sees immediately.

Open
OID
0987bc…a02a:59
assertValue details

Inspect func

assertAuthorized

func(title string)

assertAuthorized runs the write through the Authorizer, so whoever holds authority today decides: the member list at first, a DAO or a contract after a TransferManagement. The action closure is what authz authorizes; the write itself happens after, because a nil error is the only thing that reaches it.

Open
OID
0987bc…a02a:60
assertAuthorized details

Inspect func

Get

func(key string) string

Get returns a setting's value, or "" when it is not set. Reads are open: a realm importing this one calls Get on every render and pays nothing beyond the cross-realm call.

Open
OID
0987bc…a02a:61
Get details

Inspect func

GetOr

func(key string, fallback string) string

GetOr returns a setting's value, or fallback when it is unset or empty. This is the shape every consumer wants: a realm should still render on a chain where this one was never deployed with that key.

Open
OID
0987bc…a02a:62
GetOr details

Inspect func

Has

func(key string) bool

Has reports whether key is set, including to the empty string, which GetOr cannot distinguish from unset.

Open
OID
0987bc…a02a:63
Has details

Inspect func

Keys

func() []string

Keys returns every set key, in sorted order.

Open
OID
0987bc…a02a:64
Keys details

Inspect func

Size

func() int

Size returns how many settings are set.

Open
OID
0987bc…a02a:65
Size details

Inspect func

SettingsRevision

func() int

SettingsRevision counts every settings write this realm has accepted. A client that caches config polls this one int to learn that nothing moved.

Open
OID
0987bc…a02a:66
SettingsRevision details

Inspect func

Manifest

func() string

Manifest returns one tab-separated line per setting: <key>\t<rev>\t<height>\t<value> It is the whole config in one vm/qeval read, for a tool that wants to diff the chain against a local file without a call per key. The value is last because it is the only field that can contain a tab.

Open
OID
0987bc…a02a:67
Manifest details

Inspect func

MygnoscanURL

func() string

MygnoscanURL returns the explorer base moul's realms should link to, falling back to the package default when nothing is set here.

Open
OID
0987bc…a02a:68
MygnoscanURL details

Inspect func

Scanner

func() v0.Scanner

Scanner returns a link builder pointed at the configured explorer, on whichever network answers for the running chain (or at the KeyMygnoscanNetwork override, when one is set). This is the function other realms are meant to call: config.Scanner().Realm("gno.land/r/moul/home") config.Scanner().Address(someAddr) Changing where every one of them points is then one transaction against this realm, not a redeploy of each.

Open
OID
0987bc…a02a:69
Scanner details

Inspect func

Mygnoscan

func() string

Mygnoscan is the explorer page of the realm calling in.

Open
OID
0987bc…a02a:70
Mygnoscan details

Inspect func

MygnoscanFor

func(pkgPath string) string

MygnoscanFor is Mygnoscan for a named realm.

Open
OID
0987bc…a02a:71
MygnoscanFor details

Inspect func

MygnoscanFooter

func() string

MygnoscanFooter is the render-ready form: the markdown line the realm calling in appends under its output.

Open
OID
0987bc…a02a:72
MygnoscanFooter details

Inspect func

MygnoscanFooterFor

func(pkgPath string) string

MygnoscanFooterFor is MygnoscanFooter for a named realm.

Open
OID
0987bc…a02a:73
MygnoscanFooterFor details

Inspect func

Render

func(path string) string

Render shows the whole configuration: the settings, who may change them, and where this realm itself can be inspected.

Open
OID
0987bc…a02a:74
Render details

Inspect func

renderPause

func() string

renderPause reports the global pause only. A per-realm one is a setting like any other and is already in the table above; repeating them here would be a second list to keep in step, and the one a reader of THIS page wants is the switch that covers everything.

Open
OID
0987bc…a02a:75
renderPause details

Inspect func

renderProxies

func() string

renderProxies lists the later versions allowed to relay writes here. The section is omitted entirely while there are none, which is the state this realm ships in and stays in until a v2 exists.

Open
OID
0987bc…a02a:76
renderProxies details

Inspect func

renderValue

func(v string) string

renderValue puts a value in a code span and neutralises the two characters that would otherwise break out of the table cell it sits in. Only a manager can write a value, so this is about a stray pipe in a URL and not about an attacker, but a config page that silently loses a column is its own bug.

Open
OID
0987bc…a02a:77
renderValue details

Inspect func
KeyBlockTop : untyped string ="block.top"
KeyBlockBottom : untyped string ="block.bottom"
TopBlock : func() string Inspect
TopBlockFor : func(pkgPath string) string Inspect
BottomBlock : func() string Inspect
BottomBlockFor : func(pkgPath string) string Inspect
joinBlocks : func(parts []string) string Inspect
Authorizer : *v0.Authorizer Inspect
init.8 : func() Inspect
AddManager : func(addr .uverse.address) .uverse.error Inspect
RemoveManager : func(addr .uverse.address) .uverse.error Inspect
TransferManagement : func(newAuthority v0.Authority) .uverse.error Inspect
ListManagers : func() [].uverse.address Inspect
HasManager : func(addr .uverse.address) bool Inspect
ScopeSep : untyped string ="@"
maxNameLen : untyped bigint =(64 <untyped> bigint)
maxScopeLen : untyped bigint =(128 <untyped> bigint)
realmPath : untyped string ="gno.land/r/moul/config/v1"
validName : func(name string) bool Inspect
validScope : func(scope string) bool Inspect
validKey : func(key string) bool Inspect
SplitKey : func(key string) (name string, scope string) Inspect
Scope : func(pkgPath string) string Inspect
KeyFor : func(name string, pkgPath string) string Inspect
caller : func() string Inspect
scopedPair : func(name string, pkgPath string) (global string, scoped string) Inspect
KeyPause : untyped string ="pause"
Pause : func() v0.State Inspect
PauseFor : func(pkgPath string) v0.State Inspect
IsPaused : func() bool Inspect
IsPausedFor : func(pkgPath string) bool Inspect
AssertWritable : func() Inspect
AssertWritableFor : func(pkgPath string) Inspect
AssertReadable : func() Inspect
AssertReadableFor : func(pkgPath string) Inspect
proxies : *v0.Tree Inspect
AllowProxy : func(pkgPath string) Inspect
RevokeProxy : func(pkgPath string) Inspect
IsProxy : func(addr .uverse.address) bool Inspect
ListProxies : func() []string Inspect
SetAs : func(principal .uverse.address, key string, value string) Inspect
UnsetAs : func(principal .uverse.address, key string) Inspect
assertRelay : func() Inspect
assertPrincipal : func(principal .uverse.address, title string) Inspect
assertProxyPath : func(pkgPath string) Inspect
isDigits : func(s string) bool Inspect
KeyMygnoscanURL : untyped string ="mygnoscan.url"
KeyMygnoscanNetwork : untyped string ="mygnoscan.network"
maxValueLen : untyped bigint =(1024 <untyped> bigint)
setting : type =v1.setting
settings : *v0.Tree Inspect
settingsRev : int =0
Set : func(key string, value string) Inspect
Unset : func(key string) Inspect
writeSetting : func(key string, value string) Inspect
removeSetting : func(key string) Inspect
assertWritableKey : func(key string) Inspect
assertValue : func(key string, value string) Inspect
assertAuthorized : func(title string) Inspect
Get : func(key string) string Inspect
GetOr : func(key string, fallback string) string Inspect
Has : func(key string) bool Inspect
Keys : func() []string Inspect
Size : func() int Inspect
SettingsRevision : func() int Inspect
Manifest : func() string Inspect
MygnoscanURL : func() string Inspect
Scanner : func() v0.Scanner Inspect
Mygnoscan : func() string Inspect
MygnoscanFor : func(pkgPath string) string Inspect
MygnoscanFooter : func() string Inspect
MygnoscanFooterFor : func(pkgPath string) string Inspect
Render : func(path string) string Inspect
renderPause : func() string Inspect
renderProxies : func() string Inspect
renderValue : func(v string) string Inspect