Search Apps Documentation Source Content File Folder Download Copy Actions Download

v1 package

Function

Register

func Register(cur realm, username string)

Register registers a new username for the caller.

Valid usernames match `nym-[a-z]{5,13}\d{3}`:

  • literal `nym-` prefix (4 chars)
  • 5-13 lowercase letters (the alpha stem)
  • exactly 3 trailing decimal digits

Total length 12-20 chars. The alpha stem additionally must NOT start with `gno`/`gi`/`gl` and must not match a reserved role name (with implicit `s`-suffix expansion). See ValidateNymFormat for the format/blacklist check.

Canonical-collision detection is enforced atomically by susers.RegisterUser via the unified canonical store in r/sys/users (decision: per Option B, every controller participates in the same canonical-form lookup keyed by full canonical name).

Only direct EOA (maketx call) invocations are supported.

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/sys/namereg/v1" -func "Register" -args $'' -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/sys/namereg/v1" -func "Register" -args $'' -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