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

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

semverdemo/v0 package

Overview

Package semverdemo is a small on-chain demo of the semantic-versioning parser/comparator provided by the p/moul/x/daily/semver(/p/nym-moultest123/x/daily/semver/v0) library.

It holds the realm state the pure library deliberately does not: a "submitted versions" board (an avl tree of version string -> submitter address) that anyone can post to with Submit, plus a gnoweb Render view that lists them in SemVer precedence order and compares arbitrary pairs. All parsing and comparison math lives in the library; this realm is just the on-chain wiring and the view.

Functions

Render

func Render(path string) string
Ask AI Claude ChatGPT

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-moultest123/x/daily/semverdemo/v0.Render()"

Result

Submit

func Submit(cur realm, version string)
Ask AI Claude ChatGPT

Submit stores a valid version on-chain, tagged with the caller's address, so Render("/sorted") can list everyone's submissions in precedence order. It validates the input with semver.Parse and panics on anything malformed.

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/nym-moultest123/x/daily/semverdemo/v0" -func "Submit" -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-moultest123/x/daily/semverdemo/v0" -func "Submit" -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