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

wiki/v0 package

Overview

Package wiki is an open, on-chain encyclopedia: anyone can create and edit a page, every edit is a signed revision, and the whole history is public.

It is a thin realm over gno.land/p/moul/x/wiki/v0. The library owns content (titles, revisions, wikilinks, categories, diffs, rendering); this realm owns authority (who may edit what) and the chain wiring (block height, block time, the calling address, transaction links).

The split matters for reading the code: there is no policy in the library and no content logic here.

Function

Comment

func Comment(cur realm, title, body string, replyTo int) int

Comment appends a message to a page's discussion and returns its id. Pass replyTo = 0 for a new thread, or the id of a top-level message to reply to.

Commenting deliberately ignores the page's protection level: locking an article is how a steward stops an edit war, and the discussion is where that war is supposed to move. A banned address still cannot comment, and the cooldown still applies.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/moul/x/wiki/v0" -func "Comment" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/x/wiki/v0" -func "Comment" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx