func AddRelease
crossing ActionAddRelease lists a version. status is a word: draft, prerelease, supported, deprecated, yanked or vulnerable.
Package releases is the registry every version of a project asks "am I the latest, and if not, what am I allowed to d...
gno.land/r/moul/releases/v0The registry every version of a project asks "am I the latest?". One
p/moul/releases project per name, owned by the
address that opened it, each served as a stage homepage:
| path | page |
|---|---|
"" |
every project, its latest version, its owner |
"<project>" |
the stage: latest up front, every version with its status and whether it still takes writes, the changelog |
"<project>/<version>" |
one release |
import (
"chain/runtime/unsafe"
reg "gno.land/r/moul/releases/v0"
)
var self = unsafe.CurrentRealm().PkgPath() // once, at init
func Render(path string) string { return reg.Banner("myproject", self) + body(path) }
func Post(cur realm, s string) { reg.AssertWritable("myproject", self); ... }
The getters (Status, IsLatest, Latest, State, AssertWritable,
Banner, Owner, StageURL) take no realm and are called without crossing.
r/moul/demo/render is the first realm wired this way.
Every lookup is scoped by project name, which the version hard-codes. A
path is only judged by the project that names it, so nobody can pause someone
else's realm by listing its path as yanked in a project of their own. That is
why it is Status(project, path) and not Status(path).
Crossing, owner only: NewProject (first come, first served, the caller
owns it), AddRelease, SetStatus, Deprecate(version, reason, sunset),
Yank, SetSuccessor, SetDescription, TransferProject. A status is a
word: draft, prerelease, supported, deprecated, yanked,
vulnerable; latest is computed and refused.
init lists the r/moul realms that already ship two versions, owned by moul:
config, faucet and render, each with v0 deprecated (no sunset) and v1
latest. The x/ experiments are left out on purpose.
Every guarded version imports this realm, and a private realm cannot be imported. So its code is frozen at the first deploy, and the API is kept to what a version needs. The state stays writable.
A version already on chain is immutable and cannot gain the import. It is listed and labelled here, and only the stage page and the newer versions say it is old.
Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.
Dependency graph:

⚠️ Disclaimer: provided as-is, without warranty; not security-audited. Full disclaimer: DISCLAIMER.
Package releases is the registry every version of a project asks "am I the latest, and if not, what am I allowed to do?".
It stores one p/moul/releases Project per name, each owned by the address that opened it, and serves each one's stage homepage at its render path: /r/moul/releases/v0:<project>. The library is gno.land/p/moul/releases/v0; this realm is its state and its demo.
1import (
2 "chain/runtime/unsafe"
3 reg "gno.land/r/moul/releases/v0"
4)
5
6var self = unsafe.CurrentRealm().PkgPath() // computed once, at init
7
8func Render(path string) string { return reg.Banner("myproject", self) + body(path) }
9func Post(cur realm, s string) { reg.AssertWritable("myproject", self); … }
The getters take no realm, so a version calls them without crossing. Every lookup is scoped by project name, which the version hard-codes: a path is only ever judged by the project that names it, so nobody can pause someone else's realm by listing its path as yanked in a project of their own.
AddRelease lists a version. status is a word: draft, prerelease, supported, deprecated, yanked or vulnerable.
AssertWritable aborts unless the release at pkgPath still accepts writes: it is not yanked, not vulnerable, and not past a deprecation sunset.
Banner is the markdown the release at pkgPath prepends to its Render: "" for the latest or an unlisted path, a one-paragraph notice otherwise.
Deprecate marks a version deprecated: it keeps working, with a banner, until block height sunset, and is read-only from then on. 0 is never.
IsLatest reports whether pkgPath is project's latest supported release.
Latest returns project's latest supported release.
NewProject opens a project owned by the caller. First come, first served: a name is taken for good, which is why a version names its project in code before it ships.
Render serves the index of projects at "", a project's stage homepage at "<project>", and one release at "<project>/<version>". Every owner string is escaped by the library, which is where the markdown is built.
SetDescription replaces a project's one-line description.
SetStatus moves a version to a status word, with the reason readers see.
SetSuccessor sends readers of version to successor instead of to Latest.
StageURL is the link to a project's stage homepage.
State is the pause state the release at pkgPath is in at the current block, the zero (running) State when it is not listed.
Status is what project says about the release at pkgPath, with Latest computed. ok is false when the project or the path is not listed.
TransferProject hands a project to another address.
Yank withdraws a version for good. It stays listed and accepts nothing.