Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

home package

Overview

Package home is David G.'s profile page on gno.land.

gnoweb renders a profile by calling Render("") on the realm at exactly /r/<address>/home, so this path carries no /vN suffix.

The page is a list of sections, each a markdown body the owner edits with one Set transaction, so changing the text never needs a redeploy. The slot named "order" lists the sections to show. Six sections are drawn rather than stored: "hero", the page banner, "banner" and "reviews", the activity charts, "areachart", the ring of pull requests by area, "game", today's Gnordle, and "hearts", the heart count and wall.

Functions

Delete

func Delete(cur realm, name string)
Ask AI Claude ChatGPT

Delete removes one section. Only the admin can call it.

name is the section to remove, "talks" for example. Its name can stay in "order": a name with no section shows nothing.

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/g1rayfgklwl0aspz488wvrcrvt7t2quy6q06lgk2/home" -func "Delete" -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/g1rayfgklwl0aspz488wvrcrvt7t2quy6q06lgk2/home" -func "Delete" -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
  

Get

func Get(name string) string
Ask AI Claude ChatGPT

Get returns a section's markdown, or "" when it does not exist. Get("order") returns the current section list, the one to edit before setting "order".

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g1rayfgklwl0aspz488wvrcrvt7t2quy6q06lgk2/home.Get()"

Result

HasHeart

func HasHeart(addr address) bool
Ask AI Claude ChatGPT

HasHeart reports whether addr already sent a heart.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g1rayfgklwl0aspz488wvrcrvt7t2quy6q06lgk2/home.HasHeart()"

Result

Heart

func Heart(cur realm)
Ask AI Claude ChatGPT

Heart records one heart from the caller. Each address can send exactly one.

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/g1rayfgklwl0aspz488wvrcrvt7t2quy6q06lgk2/home" -func "Heart" -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/g1rayfgklwl0aspz488wvrcrvt7t2quy6q06lgk2/home" -func "Heart" -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
  

Hearts

func Hearts() int
Ask AI Claude ChatGPT

Hearts returns how many distinct addresses sent a heart.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g1rayfgklwl0aspz488wvrcrvt7t2quy6q06lgk2/home.Hearts()"

Result

Render

func Render(path string) string
Ask AI Claude ChatGPT

Render serves:

Example
1""             the profile page
2"wordle/..."   the Gnordle game
3"hearts[/<n>]" the addresses that sent a heart, heartsPerPage per page

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g1rayfgklwl0aspz488wvrcrvt7t2quy6q06lgk2/home.Render()"

Result

Set

func Set(cur realm, name, body string)
Ask AI Claude ChatGPT

Set writes one section of the page. Only the admin can call it.

name is the section to write and body is its markdown. The text sections are "header", the bio at the top, then "gno", "projects", "peerdev" and "unrelated"; any other name creates a new section.

name "order" decides which sections show and in which order. Its body lists every section name, comma separated, with no spaces. A name left out of the list is hidden, so copy the current list, from Get("order"), and edit it.

name "herotext" is the banner's text: "key value" pairs split by ";", with the keys kicker, the small line on top, title, subtitle, tagline, footline, the small line at the bottom, and alt, the banner's description for screen readers. A key left out keeps its current default.

"hero", "banner", "reviews", "areachart", "game" and "hearts" are drawn by the page itself: they cannot be set, only placed through "order".

Examples, as the two fields of the form:

Example
 1name: header
 2body: I'm a developer engineer at [Samouraï Coop](https://www.samourai.world/).
 3
 4name: herotext
 5body: title David G.; subtitle Developer engineer at Samouraï Coop; footline Open for contribution
 6
 7name: talks
 8body: ## Talks
 9
10name: order
11body: hero,header,activityhead,banner,reviews,gno,areachart,projects,peerdev,unrelated,talks,game,hearts

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/g1rayfgklwl0aspz488wvrcrvt7t2quy6q06lgk2/home" -func "Set" -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/g1rayfgklwl0aspz488wvrcrvt7t2quy6q06lgk2/home" -func "Set" -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
  

SetActivity

func SetActivity(cur realm, activity, reviews, areas string)
Ask AI Claude ChatGPT

SetActivity refreshes the three charts in one transaction. Only the admin can call it. Its three arguments are the bodies of the "activity", "reviewactivity" and "areas" sections, as scripts/activity.py prints them; an empty argument leaves that chart as it is.

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/g1rayfgklwl0aspz488wvrcrvt7t2quy6q06lgk2/home" -func "SetActivity" -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/g1rayfgklwl0aspz488wvrcrvt7t2quy6q06lgk2/home" -func "SetActivity" -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