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

v0 source realm

Package importdemo shows a realm importing and composing packages from ANOTHER namespace — the whole point of the demo.

Readme View source

gno.land/r/moul/demo/importdemo/v0

A minimal realm that imports and composes packages from another namespace — that is the whole point of the demo. It builds a small thread of posts and renders it as Markdown.

/r/moul/demo/importdemo/v0   → the demo thread

Uses p/nt/avl/v0 for ordered storage and p/nt/ufmt/v0 for formatting. Both are published on every chain we target.

Stateless: Render rebuilds the thread on every call, so its output depends only on the code.

Only depend on what the chain actually serves

An earlier cut of this demo imported gno.land/p/archive/dom, which is published on no chain we target. It type-checked locally and passed CI — the package was vendored — but could never be deployed; addpkg failed with:

could not import gno.land/p/archive/dom (unknown import path "gno.land/p/archive/dom")

That is the trap this demo now documents: a vendored dependency makes the build green regardless of whether any chain can resolve it.


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:

gno.land/r/moul/demo/importdemo/v0 dependency graph

⚠️ Disclaimer: provided as-is, without warranty; not security-audited. Full disclaimer: DISCLAIMER.

Overview

Package importdemo shows a realm importing and composing packages from ANOTHER namespace — the whole point of the demo.

v2 imported gno.land/p/archive/dom, which is published on no chain we target (absent on both sapphire and pearl), so it type-checked locally but could never be deployed: `addpkg` failed with `could not import gno.land/p/archive/dom (unknown import path)`. v2 is archived (`ignore = true`); this version rebuilds the same thread-of-posts idea on foreign packages that are actually on chain — `p/nt/avl/v0` for ordered storage and `p/nt/ufmt/v0` for formatting.

Deliberately keeps no realm state: Render builds the thread on each call, so output depends only on the code and the demo is reproducible.

Functions 1

func Render

1func Render(path string) string
source

Render renders the demo thread for gnoweb.

Imports 4

Source Files 3