Search Apps Documentation Source Content File Folder Download Copy Actions Download

guestbook package

Overview

Package guestbook is a public, on-chain guestbook realm for gno.land.

Anyone can sign the guestbook with a short message via the Sign crossing function. Every entry records the caller's address, the message, and the block height at which it was signed. Render lists all entries newest-first as a Markdown table.

Functions

Count

func Count() int

Count returns the total number of signatures. Read-only, non-crossing.

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/guestbook.Count()"

Result

Render

func Render(path string) string

Render lists every entry newest-first as a Markdown table plus a total count.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/guestbook.Render()"

Result

Sign

func Sign(cur realm, message string)

Sign appends a new entry to the guestbook attributed to the immediate caller.

It is a crossing function (gno 0.9 interrealm convention): callers invoke it as Sign(cross(cur), "hello"). The cur.IsCurrent() guard is the authentication primitive — without it a stale/forged realm value could spoof the author.

Param

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/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/guestbook" -func "Sign" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/guestbook" -func "Sign" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx