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

threads/v0 package

Overview

Package threads is a discussion block any realm can embed, keyed on the page it appears on rather than on the realm that stores it.

It is the text half of gno.land/r/moul/reactions: the same embed shape, the same page keys, two lines in the host realm.

Example
1import "gno.land/r/moul/x/social/threads/v0"
2
3func Render(path string) string {
4	return body + threads.RenderBlock()
5}

RenderBlock takes no argument because it does not need one: a plain read exported by a realm and called by another opens no realm frame, so unsafe.CurrentRealm() inside it reports the CALLER. The host realm's own path is the page key, and nothing has to be configured or registered. RenderBlockFor is the explicit form, for a realm that renders more than one page or already holds its path as a constant.

The token, and the three things it has to answer

THREAD exists because placement is the one thing a discussion has that people want and cannot all have at once.

Example
1mint   1 THREAD to a thread's author, the first time each distinct
2       address replies to it. People, not messages, and never yourself.
3sink   [Boost] burns PinCost THREAD to pin a thread to the top of its
4       page for PinBlocks blocks. That is the only thing that removes
5       supply, and the only thing the token does.
6buyer  anyone who wants placement and has not earned it. They have to
7       acquire THREAD from someone who did, with [Transfer], which is
8       what makes attention a market rather than a scoreboard.

It is farmable, and saying so is cheaper than pretending otherwise: two addresses replying to each other mint one THREAD each per thread. The fix is a gate on who counts as a replier, which belongs in a vouching realm and not here; until then the cost of farming is one transaction per point and the benefit is capped by what a pin is worth.

Function

Boost

func Boost(cur realm, threadID int64)

Boost burns PinCost THREAD from the caller and pins the thread to the top of its page for PinBlocks blocks.

Anyone may boost anyone's thread. The pin is on the thread and not on the buyer, so the thing being sold is placement and not authorship.

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/moul/x/social/threads/v0" -func "Boost" -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/social/threads/v0" -func "Boost" -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