Search Apps Documentation Source Content File Folder Download Copy Actions Download

checkin package

Overview

Package checkin is a public check-in board: anyone can check in once, the board records their address, and Render lists everyone so far.

Functions

CheckIn

func CheckIn(cur realm)

CheckIn records the caller's address on the board. Anyone may check in — an EOA or another realm — but only once; a second check-in reverts.

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/g1nph5k7x80w80p5shatjkr6v6p7z0yzyrjwam2n/checkin" -func "CheckIn" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1nph5k7x80w80p5shatjkr6v6p7z0yzyrjwam2n/checkin" -func "CheckIn" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

HasCheckedIn

func HasCheckedIn(addr address) bool

HasCheckedIn reports whether addr has checked in.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/g1nph5k7x80w80p5shatjkr6v6p7z0yzyrjwam2n/checkin.HasCheckedIn()"

Result

Render

func Render(path string) string

Render lists everyone checked in so far, sorted by address, with each entry's arrival number. Only the home path is served.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/g1nph5k7x80w80p5shatjkr6v6p7z0yzyrjwam2n/checkin.Render()"

Result

Total

func Total() int

Total returns the number of addresses checked in so far.

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/g1nph5k7x80w80p5shatjkr6v6p7z0yzyrjwam2n/checkin.Total()"

Result