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

gns/v1 package

Overview

Package gns implements GNS (Gno Name Service): an ENS-equivalent naming system expressed as a single Gno-native realm.

The design goal is NOT byte-for-byte ENS compatibility. Instead it provides the same user-facing capabilities (registration, renewal, expiry/grace, forward & reverse resolution, primary names, typed + arbitrary records, subnames with policies, delegated operators, pagination and events) through ONE realm, ONE ownership model, ONE record model, ONE authorization function and ONE registration lifecycle.

Key deviations from a naive port of the spec, forced by gno semantics:

  • State-mutating exported functions are "crossing" functions: they take `cur realm` as the first parameter and PANIC (abort) on failure rather than returning an error, because in gno only a panic/abort reverts state. Failures panic with a stable machine-readable code (see the error_* set).
  • Persistent, enumerable collections use avl.Tree (ordered, paginatable) instead of Go maps, so every listing API is bounded and cursor-based.
  • Names are stored string-native (canonical "label.parent"), not namehashed.

See README.md for the full compatibility statement.

Function

SetRecord

func SetRecord(cur realm, name string, namespace string, key string, value []byte)

SetRecord sets an arbitrary namespaced record. Reserved namespaces are rejected; use the typed setters for those.

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/gns/v1" -func "SetRecord" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "pearl-1" -remote "https://rpc.pearl.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.pearl.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/gns/v1" -func "SetRecord" -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 "pearl-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.pearl.testnets.gno.land" call.tx