Allowance
Allowance is what owner let spender draw.
Command
gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/social/threads/v0.Allowance(,)"
Result
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.
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.
THREAD exists because placement is the one thing a discussion has that people want and cannot all have at once.
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.
Allowance is what owner let spender draw.
gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/social/threads/v0.Allowance(,)"
Approve lets spender draw amount of the caller's THREAD.
# 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 "Approve" -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/social/threads/v0" -func "Approve" -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
BalanceOf is an address's THREAD balance.
gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/social/threads/v0.BalanceOf()"
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.
# 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
Count is how many threads a page holds.
gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/social/threads/v0.Count()"
Pages is how many pages have ever been posted on.
gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/social/threads/v0.Pages()"
PinnedUntil is the height a thread stops being pinned at, or 0.
gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/social/threads/v0.PinnedUntil()"
Post opens a thread under page.
page is a package path, the full one: "gno.land/r/moul/home". It does not have to be a realm that embeds the block, and nothing checks that it exists. A page is just a name, which is what lets a realm key discussion on something finer than itself.
# 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 "Post" -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/social/threads/v0" -func "Post" -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
Render routes three views: the realm's own index, one page's threads, and one thread.
A page key contains slashes, so "page/<key>" is split on the prefix rather than by path element: realmpath gives the parts, and rejoining them would only be a way to get it wrong.
gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/social/threads/v0.Render()"
RenderBlock returns the block for the realm CALLING it, which is the form a host realm embeds.
It has no cur realm parameter on purpose. A plain read is borrowed: gno opens no realm frame for it, so unsafe.CurrentRealm() reports the caller's path and the block keys itself with no argument. Adding a cur realm here would silently reverse that and key every embed to this realm instead.
gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/social/threads/v0.RenderBlock()"
RenderBlockFor is RenderBlock for a named page. Use it from a crossing function, where there is no caller to read off the stack, or when one realm renders several pages.
gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/social/threads/v0.RenderBlockFor()"
Repliers is how many distinct addresses have replied to a thread, which is also how much its author has earned from it.
gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/social/threads/v0.Repliers()"
Reply appends to a thread.
The first time each distinct address replies to a given thread, its author earns EarnPerReplier. Replying again earns nothing, and replying to your own thread never earns anything.
# 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 "Reply" -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/social/threads/v0" -func "Reply" -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
TokenKey is the r/nt/grc20reg key for THREAD.
gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/social/threads/v0.TokenKey()"
Total is how many threads exist, across every page.
gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/social/threads/v0.Total()"
TotalSupply is the THREAD in existence: everything earned, less everything burned by Boost.
gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/social/threads/v0.TotalSupply()"
Transfer moves the caller's own THREAD. It is what makes the sink a market: somebody who wants a pin and has written nothing has to buy from an author.
# 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 "Transfer" -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/social/threads/v0" -func "Transfer" -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
TransferFrom spends an allowance the caller was granted.
# 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 "TransferFrom" -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/social/threads/v0" -func "TransferFrom" -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