Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

advent/v2 package

Overview

Package advent is Gnoël, an on-chain advent calendar with sealed guesses.

Functions

Attempts

func Attempts(day, start int) string

Attempts returns one bounded page of the public record, starting at a 1-based ID.

Params

Command

gnokey query vm/qeval -remote "tcp://127.0.0.1:18899" -data "gno.land/r/moul/advent/v2.Attempts(,)"

Result

Calendar

func Calendar() string

Calendar returns tab-separated rows for open doors, with title and clue in base64.

Command

gnokey query vm/qeval -remote "tcp://127.0.0.1:18899" -data "gno.land/r/moul/advent/v2.Calendar()"

Result

CarryOver

func CarryOver(cur realm, player address, commitment, sealedSalt string)

CarryOver records a pending seal from the first deployment on Onyx.

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/moul/advent/v2" -func "CarryOver" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "dev" -remote "tcp://127.0.0.1:18899" ADDRESSgnokey query -remote "tcp://127.0.0.1:18899" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/advent/v2" -func "CarryOver" -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 "dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "tcp://127.0.0.1:18899" call.tx
  

FinishCarryOver

func FinishCarryOver(cur realm)

FinishCarryOver closes imports and opens regular submissions and reviews.

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/advent/v2" -func "FinishCarryOver" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "dev" -remote "tcp://127.0.0.1:18899" ADDRESSgnokey query -remote "tcp://127.0.0.1:18899" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/advent/v2" -func "FinishCarryOver" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "tcp://127.0.0.1:18899" call.tx
  

Leaders

func Leaders() string

Leaders returns the top 24 addresses with their confirmed solves.

Command

gnokey query vm/qeval -remote "tcp://127.0.0.1:18899" -data "gno.land/r/moul/advent/v2.Leaders()"

Result

Progress

func Progress(player string) string

Progress lists the latest status of an address across all 24 doors.

Param

Command

gnokey query vm/qeval -remote "tcp://127.0.0.1:18899" -data "gno.land/r/moul/advent/v2.Progress()"

Result

Publish

func Publish(cur realm, day int, title, clue, publicKey string, reviewFrom int64)

Publish opens a case. The RSA-2048 SPKI public key is pinned for that case so that rotating the key for a new door leaves old doors playable.

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/moul/advent/v2" -func "Publish" -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "dev" -remote "tcp://127.0.0.1:18899" ADDRESSgnokey query -remote "tcp://127.0.0.1:18899" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/advent/v2" -func "Publish" -args $'' -args $'' -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 "dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "tcp://127.0.0.1:18899" call.tx
  

Render

func Render(path string) string

Render prepends the release banner, "" while this version is the latest or unlisted, so an old copy tells its readers where the game moved.

Param

Command

gnokey query vm/qeval -remote "tcp://127.0.0.1:18899" -data "gno.land/r/moul/advent/v2.Render()"

Result

ReplaceGuess

func ReplaceGuess(cur realm, day int, commitment, sealedSalt string) int

ReplaceGuess reseals the caller's current guess while it awaits review.

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/moul/advent/v2" -func "ReplaceGuess" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "dev" -remote "tcp://127.0.0.1:18899" ADDRESSgnokey query -remote "tcp://127.0.0.1:18899" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/advent/v2" -func "ReplaceGuess" -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 "dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "tcp://127.0.0.1:18899" call.tx
  

Review

func Review(cur realm, day, start int, verdicts, snapshot string)

Review records one verdict per consecutive attempt, starting at the first pending ID. A stale batch fails before it can apply verdicts to other guesses.

It asks only that this version be readable, not writable: past a deprecation sunset no new guess gets in, but the seals already sent are still owed a verdict. A yanked or vulnerable version refuses it too.

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/moul/advent/v2" -func "Review" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "dev" -remote "tcp://127.0.0.1:18899" ADDRESSgnokey query -remote "tcp://127.0.0.1:18899" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/advent/v2" -func "Review" -args $'' -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 "dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "tcp://127.0.0.1:18899" call.tx
  

SetOracle

func SetOracle(cur realm, signer address)

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/advent/v2" -func "SetOracle" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "dev" -remote "tcp://127.0.0.1:18899" ADDRESSgnokey query -remote "tcp://127.0.0.1:18899" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/advent/v2" -func "SetOracle" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "tcp://127.0.0.1:18899" call.tx
  

SetPublisher

func SetPublisher(cur realm, signer address)

SetPublisher delegates publishing and clue corrections to another account. Like SetOracle it ignores the release status: rotating a leaked key must still work on a version that is yanked or vulnerable.

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/advent/v2" -func "SetPublisher" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "dev" -remote "tcp://127.0.0.1:18899" ADDRESSgnokey query -remote "tcp://127.0.0.1:18899" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/advent/v2" -func "SetPublisher" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "tcp://127.0.0.1:18899" call.tx
  

Submit

func Submit(cur realm, day int, commitment, sealedSalt string) int

Submit publicly records the commitment and its encrypted random salt.

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/moul/advent/v2" -func "Submit" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "dev" -remote "tcp://127.0.0.1:18899" ADDRESSgnokey query -remote "tcp://127.0.0.1:18899" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/advent/v2" -func "Submit" -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 "dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "tcp://127.0.0.1:18899" call.tx
  

UpdateClue

func UpdateClue(cur realm, day int, clue string)

UpdateClue corrects the text of an open door while keeping its review schedule, oracle key and submissions intact.

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/moul/advent/v2" -func "UpdateClue" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "dev" -remote "tcp://127.0.0.1:18899" ADDRESSgnokey query -remote "tcp://127.0.0.1:18899" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/advent/v2" -func "UpdateClue" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "tcp://127.0.0.1:18899" call.tx
  

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/moul/advent/v2, for example a function call with arguments.