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 source realm

Package microblog is a public microblog wall for gno.land.

Readme View source

Microblog Wall

⚠️ Experimental — generated with no human supervision. This realm was produced automatically by an MCP-driven agent to exercise the gno MCP server and tooling, and to generate test content for gno compilers, linters and formatters. Not audited. Not for production. Full context & folder README: r/moul/x/daily


A public, append-only microblog for gno.land. Anyone can post a short message (up to 280 bytes); each post records the caller's address and the block height at which it was made. The Render view shows the wall newest-first, 20 posts per page, with total count and prev/next pagination driven by the render path.

  • Realm path: gno.land/r/REPLACE_ADDR/microblog
  • Gno version: 0.9 (sapphire)

API

  • Post(cur realm, msg string) — crossing tx. Panics if msg is empty or longer than 280 bytes. Stores {author, msg, height}.
  • Count() int — total number of posts.
  • Render(path string) string — Markdown wall, newest-first, paginated.

Example calls

Post a message (crossing call via gnokey):

1gnokey maketx call \
2  -pkgpath "gno.land/r/REPLACE_ADDR/microblog" \
3  -func Post \
4  -args "gm gno.land 👋" \
5  -gas-fee 1000000ugnot -gas-wanted 2000000 \
6  -broadcast -chainid sapphire-1 -remote <rpc> mykey

View the wall in gnoweb:

https://gno.land/r/REPLACE_ADDR/microblog          # page 1 (newest 20)
https://gno.land/r/REPLACE_ADDR/microblog:?page=2  # older posts
https://gno.land/r/REPLACE_ADDR/microblog:/2       # same page, path form

From another realm:

1import "gno.land/r/REPLACE_ADDR/microblog"
2
3func Shout(cur realm) {
4    microblog.Post(cross(cur), "posted from another realm")
5}

What changed in v1

Identical behaviour to v0 apart from rendering, which now goes through p/moul/kit/ui instead of the local escapeInline, shortAddr helpers.

One address format. Eleven realms carried their own shortAddr with four different truncation rules, so the same account rendered differently depending on which realm you opened. ui.Addr is that decision made once: 8 leading characters, an ellipsis, 4 trailing, in backticks.

Real escaping. The local helper replaced a handful of markdown metacharacters. ui.Inline and ui.Cell delegate to p/nt/markdown/sanitize, which also strips bidi and zero-width characters and folds newlines, so user text cannot reorder or escape the line it sits on.

Visible change: addresses now render in monospace.

The rendering change means the output differs from v0, which under this repo's versioning rule is a compatibility change, hence a new version rather than an edit in place. v0 stays live and untouched.


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/x/daily/microblog/v1 dependency graph

🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.

Overview

Package microblog is a public microblog wall for gno.land.

Anyone can Post a short message (<= maxMsgLen chars). Every post records the caller address, the message, and the block height at which it was made. Render displays the wall newest-first, 20 posts per page, with pagination driven by the Render path (e.g. "?page=2" or "/2").

Functions 3

func Count

Action
1func Count() int
source

Count returns the total number of posts on the wall.

func Post

crossing Action
1func Post(cur realm, msg string)
source

Post publishes msg to the wall. It is a crossing function: callers invoke it with Post(cross(cur), "hello"). It panics if msg is empty or longer than maxMsgLen bytes.

func Render

1func Render(path string) string
source

Render renders the wall as Markdown, newest-first, pageSize posts per page. The page is parsed from path: "?page=N", "?p=N", "/N", or a bare "N" all select page N (1-indexed). Anything else defaults to page 1.

Imports 6

Source Files 4