Search Apps Documentation Source Content File Folder Download Copy Actions Download

v1 package

Functions

Canonicalize

func Canonicalize(s string) string

Canonicalize is a delegating shim to r/sys/users.Canonicalize.

HISTORY: namereg/v1 used to host its own per-stem canonical store and its own Canonicalize (l→i only). Option B unified the canonical lookup into r/sys/users keyed by full canonical name with broader substitutions ({l,i,1}→i, {0,o}→o, {-,.,_} stripped). This shim preserves the call-site name for local consumers (blacklist init, IsReserved) and any external consumer that imported the function from namereg/v1 before Option B.

New code should call susers.Canonicalize directly.

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/namereg/v1.Canonicalize()"

Result

IsPaused

func IsPaused() bool

IsPaused exposes the realm's pause flag for cross-controller coordination.

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/namereg/v1.IsPaused()"

Result

IsReserved

func IsReserved(stem string) bool

IsReserved reports whether the given alpha stem matches a reserved role name (with implicit `s`-suffix expansion). The check is canonicalized — so `vital1k`-style l-substituted variants of a reserved name are also caught. O(1) backed by `reservedSet` built in init().

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/namereg/v1.IsReserved()"

Result

NewSetPausedExecutor

func NewSetPausedExecutor(newPausedValue bool) dao.ProposalRequest

NewSetPausedExecutor allows GovDAO to pause or unpause this realm

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/namereg/v1.NewSetPausedExecutor()"

Result

ProposeDeleteUser

func ProposeDeleteUser(addr address, reason string) dao.ProposalRequest

ProposeDeleteUser allows GovDAO to propose deletion of a user This will make the associated address and names unresolvable. WARN: After deletion, the same address WILL NOT be able to register a new name.

Params

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/namereg/v1.ProposeDeleteUser(,)"

Result

ProposeNewName

func ProposeNewName(addr address, newName string) dao.ProposalRequest

ProposeNewName allows GovDAO to propose a new name for an existing user. The associated address and all previous names of a user that changes a name are preserved, and all resolve to the new name.

Governance renames bypass the Open Nym Tier `nym-...\d{3}` format intentionally. The DAO is the trust root for this realm; if voters approve a rename to `vitalik` (e.g. for trademark dispute resolution or system reservations), the validation here imposes no further opinion. The new name is still subject to the base shape enforced by `r/sys/users.validateName` (`^[a-z][a-z0-9]*([_-][a-z0-9]+)*$`, max 64 chars), which runs inside the updateUsername callback below.

Params

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/namereg/v1.ProposeNewName(,)"

Result

ProposeNewRegisterPrice

func ProposeNewRegisterPrice(newPrice int64) dao.ProposalRequest

ProposeNewRegisterPrice allows GovDAO to update the price of registration. Rejects prices below MinRegisterPrice (currently 0) at proposal-creation time. (audit finding #14: original code only rejected negative values, which would have been arithmetically nonsensical.)

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/namereg/v1.ProposeNewRegisterPrice()"

Result

Register

func Register(_ 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 "dev" -remote "https://api.gno.berty.io:443" ADDRESSgnokey query -remote "https://api.gno.berty.io:443" 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 "dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://api.gno.berty.io:443" call.tx
  

Render

func Render(path string) string

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/namereg/v1.Render()"

Result

RenderLatestUsersWidget

func RenderLatestUsersWidget(num int) string

RenderLatestUsersWidget renders the latest num registered users. For num = -1, the maximum number (100) will be displayed.

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/namereg/v1.RenderLatestUsersWidget()"

Result

ValidateNymFormat

func ValidateNymFormat(username string) error

ValidateNymFormat checks the regex, prefix-exclusion, and reserved- name rules in that order. Returns one of the exported sentinel errors per failure mode, or nil on success.

Does NOT run the canonical-collision check — that lives in r/sys/users (susers.IsCanonicalTaken or, atomically with the write, inside susers.RegisterUser).

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/namereg/v1.ValidateNymFormat()"

Result