Gno.land
Package memfs is a RAM file server: Plan 9's ramfs, in a realm's heap. It is the reference implementation of gno.land/p/moul/x/plan9/ninep's File and Mutable, and the tree a namespace server hands out as a user's private root. Children live in an avl.Tree, so a directory listing is ordered by name and therefore identical on every validating node; a map would make Render a consensus bug. Mutable is IN-REALM ONLY. A non-crossing method runs in the caller's frame, so a foreign realm calling Create or Write here would be mutating objects it does not own. Reads (the ninep.File half) are safe from anywhere, which is what makes a memfs tree mountable into somebody else's namespace. The caller supplies the clock (a block height) on every mutation rather than the tree reading chain state itself, so the same tree is exercisable in a plain unit test. 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.