Gno.land
Package synfs builds a synthetic, read-only ninep file server whose contents are computed by a function at read time. This is the package that makes the rest of the suite adoptable. Plan 9's device drivers are not storage, they are code behind a name: reading /dev/time runs a function. A realm that wants to publish its state as a browsable tree does the same thing here, in a few lines, and gets ls, cat, stat and mountability for free: t := synfs.New("dev", "g1...", func() int64 { return runtime.ChainHeight() }) t.Root(). Add("sysname", func() string { return runtime.ChainID() }). Add("height", func() string { return strconv.FormatInt(runtime.ChainHeight(), 10) }) The tree is READ-ONLY by construction, which is what makes it safe to hand to another realm's namespace: every method is free of side effects, so it can be called from a frame that does not own these objects. A synthetic file reports Qid.Version 0 forever. Its contents can change on every block, so a version would be a lie; clients that need change detection should read the file. NOTICE. Plan 9 from Bell Labs is the work of the Computing Science Research Center at Bell Labs; the name and the marks are theirs, and the copyright is held by the Plan 9 Foundation ([https://p9f.org](https://p9f.org)). This package is not affiliated with, endorsed by, or sponsored by them, and contains no Plan 9 code: it borrows the vocabulary so that the design reads without a glossary, and it is an homage, asking what that ecosystem's spirit looks like on a chain. Full attribution: NOTICE.md at the root of moul/gno-contracts.