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

guilds package

Overview

Package guilds records which Discord server a court's moderators chose.

WHY A SEPARATE REALM. kourtv2 is deployed and knows nothing about Discord, and a realm on chain is not edited — adding a field there means a new realm and a migration for every court that exists. This holds one string per court and asks kourtv2 who may set it, so the court's own moderator list stays the only authority and this file never has one of its own.

WHY IT EXISTS AT ALL, when the service could verify a signed message and did. It could, and the signature had to be made at a terminal, because a wallet signs TRANSACTIONS and not arbitrary strings. So the last step of standing up a court's Discord server was a command nobody would ever discover, and the court page said so and stopped. A realm call IS a transaction, which is exactly what a wallet already does — the same button every other action on the page uses.

WHAT IT DOES NOT DO. It does not check that the guild exists, that the bot is in it, or that anybody can join it. Those are the service's to know and it already does; this records a CHOICE, made by an address the court recognises, at a height anybody can read back. A guild id here with no bot behind it is a court pointing at nothing, which is visible rather than dangerous.

Function

Set

func Set(cur realm, courtSlug, guildID string)

Set records the guild for a court, or clears it when guildID is empty.

THE CALLER IS THE MODERATOR, NOT THIS REALM. cur.Previous().Address() is who asked, and kourt.IsCourtMod is the only thing consulted — so a moderator removed by the court loses this at the same moment, with no state here to keep in step. IsCourtMod panics on a court that does not exist, which is the answer we want: there is nothing to bind.

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/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/guilds" -func "Set" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "http://127.0.0.1:26657" ADDRESSgnokey query -remote "http://127.0.0.1:26657" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/guilds" -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 "http://127.0.0.1:26657" call.tx