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

golf package

Overview

Package golf is the game realm: it keeps the holes, the players' rounds, the records and the rankings. Every hole is data (a GG1 string, p/…/course), never code: golf decodes it and plays it with p/…/physics. The owner publishes the course's holes into slots of a cup ("garden/7"), each publish a new version ("garden/7/v2"); once the owner opens publishing, anyone can publish a community hole ("<address>/<slug>/v1", PublishMine), playable and recorded but outside the course and its ranking.

Reads take a version's id or its alias ("garden/7", "<address>/<slug>"), its current version. Writes take the exact id only, as HoleState or Holes gave it: a round cannot be replayed on a version it was not played on.

Who can change what (in full on the hub page): the owner holds one power, the course itself: its holes (Publish), what the lists show (Hide), and whether anyone can publish (SetPublishing).

Function

PlayRoundAt

func PlayRoundAt(cur realm, hole string, shots string, period int64) string

PlayRoundAt replays shots into the caller's assisted round on hole (an exact id), continuing it, in the weather of period: the current one or the one before, and a round under way keeps its own. The client sends decisions, never outcomes: the chain replays them.

shots is "angle,power[,tick];…" (MsgCall carries no slice), at most 12, fewer on a heavy hole: a commit past the work budget is refused with the number of shots that fit, and the rest goes in the next commit.

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/nym-alexiscolin000/gnogolf/golf" -func "PlayRoundAt" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-alexiscolin000/gnogolf/golf" -func "PlayRoundAt" -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 "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx