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

service_registry state

Back to all declarations

Service

type

Service represents a registered on-chain service.

Value

service_registry.Service

Reservation

type

Reservation holds a deregistered name for its former owner AND its original registrant, and EXPIRES (re-audit 2026-09-02): an eternal reservation let an attacker cycle register/deregister to lock the whole namespace forever, and a hostile transferee could strand a name against its original registrant permanently.

Value

service_registry.Reservation

MaxServices

untyped bigint

Value

(1000 <untyped> bigint)

MaxServicesPerOwner

untyped bigint

Value

(20 <untyped> bigint)

MaxNameLen

untyped bigint

Value

(64 <untyped> bigint)

MaxTypeLen

untyped bigint

Value

(32 <untyped> bigint)

MaxPkgPathLen

untyped bigint

Value

(128 <untyped> bigint)

MaxDescriptionLen

untyped bigint

Value

(500 <untyped> bigint)

MaxMetadataLen

untyped bigint

Value

(2000 <untyped> bigint)

pkgPathPrefix

untyped string

Value

"gno.land/"

ReservationPeriod

int64

// 90 days

Value

7776000

MaxRenderServices

untyped bigint

Value

(25 <untyped> bigint)

renderDescLen

untyped bigint

Value

(60 <untyped> bigint)

services

map[string]*service_registry.Service
Open
OID
016e6e…dfc1:35
services details

Inspect map

names

[]string (len=5)

// insertion-ordered list for deterministic iteration

Open
OID
016e6e…dfc1:54
names details (len=5)

+5 more Inspect slice

retired

map[string]*service_registry.Reservation
Open
OID
016e6e…dfc1:37
retired details

Inspect map

ownerServices

map[.uverse.address]int
Open
OID
016e6e…dfc1:38
ownerServices details

Inspect map

pendingOwners

map[string].uverse.address
Open
OID
016e6e…dfc1:39
pendingOwners details

Inspect map

rejectStraySend

func()

rejectStraySend aborts when coins are attached to a call (pearl audit Y2): this realm handles no funds, holds no banker and exposes no withdrawal, so an attached send would strand on the realm address forever. Aborting reverts the transfer back to the sender. Fails open for realm-routed calls, whose attached send lands on the intermediary realm, never here.

Open
OID
016e6e…dfc1:10
rejectStraySend details

Inspect func

quotaAdd

func(owner .uverse.address)
Open
OID
016e6e…dfc1:11
quotaAdd details

Inspect func

quotaDrop

func(owner .uverse.address)
Open
OID
016e6e…dfc1:12
quotaDrop details

Inspect func

assertQuota

func(owner .uverse.address)
Open
OID
016e6e…dfc1:13
assertQuota details

Inspect func

isValidName

func(name string) bool
Open
OID
016e6e…dfc1:14
isValidName details

Inspect func

validatePkgPath

func(pkgPath string)
Open
OID
016e6e…dfc1:15
validatePkgPath details

Inspect func

validateFields

func(description string, serviceType string, metadata string)
Open
OID
016e6e…dfc1:16
validateFields details

Inspect func

truncate

func(s string, n int) string

truncate shortens s to at most n runes without splitting a multibyte character. Applied to RAW text, never to escaped output — truncating after escaping could sever a \`\\x\` pair and leave a dangling backslash.

Open
OID
016e6e…dfc1:17
truncate details

Inspect func

mustGet

func(name string) *service_registry.Service
Open
OID
016e6e…dfc1:18
mustGet details

Inspect func

RegisterService

func(name string, pkgPath string, description string, serviceType string, metadata string)

RegisterService adds a new service to the registry. The caller becomes the owner. Name must be unique, lowercase alphanumeric/underscores. pkgPath is the realm the service lives at — the field integrators resolve — and must look like a gno.land package path. A name that was deregistered stays reserved for its former owner and its original registrant for ReservationPeriod. NOTE: this realm does NOT and cannot verify that pkgPath exists or that the caller controls it. See the INTEGRATOR CONTRACT on Resolve.

Open
OID
016e6e…dfc1:19
RegisterService details

Inspect func

UpdateService

func(name string, pkgPath string, description string, serviceType string, metadata string)

UpdateService modifies a service's pkgpath, description, type, and metadata. Only the registered owner can update. Name cannot change. An update MAY REPOINT the name at a different package path. That is a deliberate capability (services move, and versions supersede), but it also means a name an integrator trusts today can point elsewhere tomorrow. The ServiceUpdated event carries both the old and the new path specifically so a repoint is observable in the transaction log rather than something a consumer has to poll for.

Open
OID
016e6e…dfc1:20
UpdateService details

Inspect func

TransferOwnership

func(name string, newOwner .uverse.address)

TransferOwnership NOMINATES a new owner for a service entry; the nominee must call AcceptOwnership to take control (pearl audit Y4). The one-step form this replaces was a permanent-brick hazard: address.IsValid() only checks bech32 form, so a well-formed but unowned destination passed the check and committed immediately, after which the entry could never again be updated, transferred or deregistered — and because it could never be deregistered it could never enter the reservation window either, so the NAME became a permanent hole in a shared global namespace. Nomination changes nothing: the sitting owner keeps full control until the nominee consents. Passing "" clears a pending nomination.

Open
OID
016e6e…dfc1:21
TransferOwnership details

Inspect func

AcceptOwnership

func(name string)

AcceptOwnership completes a nominated handoff. Only the nominee can accept, and the nominee's own quota is checked HERE — at consent — so a nomination can never push an account past MaxServicesPerOwner without that account agreeing to it.

Open
OID
016e6e…dfc1:22
AcceptOwnership details

Inspect func

CancelOwnershipTransfer

func(name string)

CancelOwnershipTransfer withdraws a pending nomination. Owner-only.

Open
OID
016e6e…dfc1:23
CancelOwnershipTransfer details

Inspect func

Deregister

func(name string)

Deregister removes a service from the registry. Only the owner can deregister. The name stays reserved for the former owner and the original registrant for ReservationPeriod — it cannot be re-registered by anyone else in that window, so integrators who still resolve it can never be silently redirected by a squatter.

Open
OID
016e6e…dfc1:24
Deregister details

Inspect func

Resolve

func(name string) string

Resolve returns the pkgpath a service name points to — the primary integration query. Panics on unknown names so a consumer can never silently integrate against a missing entry. INTEGRATOR CONTRACT — read this before trusting a resolution: 1. A resolution is an ATTESTATION, NOT A PROOF. This realm records that some address claimed a name for some package path. It does NOT verify that the path exists, that it is deployed, or that the registrant controls it. Contrast r/demo/defi/grc20reg, which proves control by requiring the registered token object to originate from the calling realm; no equivalent proof exists for a bare path string, and requiring one would mean only realms — never their operators — could ever register a name, which is not this registry's model. 2. A NAME IS NOT AN AUTHORIZATION. Never grant a privilege, route a payment, or admit a caller because Resolve returned its path. Resolution answers "where does this name point", never "may this caller act". Derive authority from your own crossing entrypoint's cur.Previous(), or from an explicit access-control realm. 3. THE TARGET CAN CHANGE. The owner may repoint a name at any time via UpdateService, and ownership itself is transferable. Treat a resolution as valid only for the transaction that read it; cache it and you inherit whatever the name points at later. The ServiceUpdated and OwnershipTransferred events exist so movement is detectable.

Open
OID
016e6e…dfc1:25
Resolve details

Inspect func

TryResolve

func(name string) (string, bool)

TryResolve is the non-panicking variant for consumers that need to degrade gracefully when a name disappears (re-audit: a panicking-only read path bricks any consumer realm that calls it inline). The INTEGRATOR CONTRACT documented on Resolve applies here identically.

Open
OID
016e6e…dfc1:26
TryResolve details

Inspect func

GetOwner

func(name string) .uverse.address
Open
OID
016e6e…dfc1:27
GetOwner details

Inspect func

GetPendingOwner

func(name string) string

GetPendingOwner returns the nominated-but-not-yet-accepted owner of a service, or "none" when no handoff is open.

Open
OID
016e6e…dfc1:28
GetPendingOwner details

Inspect func

ServiceCount

func() (count int, limit int)

ServiceCount returns how many services are registered and the global cap, so a caller can check headroom without pulling the whole list.

Open
OID
016e6e…dfc1:29
ServiceCount details

Inspect func

OwnerServiceCount

func(owner .uverse.address) (count int, limit int)

OwnerServiceCount returns how many services an address currently holds and the per-owner cap.

Open
OID
016e6e…dfc1:30
OwnerServiceCount details

Inspect func

GetService

func(name string) string

GetService returns a formatted summary of a registered service. Free text is escaped for a single-line markdown slot.

Open
OID
016e6e…dfc1:31
GetService details

Inspect func

ListServices

func() string

ListServices returns all registered service names as a comma-separated string in registration order. COST NOTE: this is O(MaxServices) and is deliberately NOT truncated — an integrator enumerating the registry needs the complete set, and the caller pays for its own read. Render, whose cost lands on third-party viewers instead, IS bounded.

Open
OID
016e6e…dfc1:32
ListServices details

Inspect func

ListByType

func(serviceType string) string

ListByType returns all service names matching a given type. Same cost note as ListServices.

Open
OID
016e6e…dfc1:33
ListByType details

Inspect func

Render

func(path string) string

Render returns a markdown overview, bounded to MaxRenderServices rows (pearl audit Y3). Never panics. All free text goes through the ecosystem sanitizer rather than a bespoke escaper: the hand-rolled replacement of backticks and pipes it replaces left \`\[\`, \`]\`, \`(\`, \`)\` and \`!\` live, so any registrant could inject a working markdown link or image into a table cell and phish every viewer of this page.

Open
OID
016e6e…dfc1:34
Render details

Inspect func
Service : type =service_registry.Service
Reservation : type =service_registry.Reservation
MaxServices : untyped bigint =(1000 <untyped> bigint)
MaxServicesPerOwner : untyped bigint =(20 <untyped> bigint)
MaxNameLen : untyped bigint =(64 <untyped> bigint)
MaxTypeLen : untyped bigint =(32 <untyped> bigint)
MaxPkgPathLen : untyped bigint =(128 <untyped> bigint)
MaxDescriptionLen : untyped bigint =(500 <untyped> bigint)
MaxMetadataLen : untyped bigint =(2000 <untyped> bigint)
pkgPathPrefix : untyped string ="gno.land/"
ReservationPeriod : int64 =7776000
MaxRenderServices : untyped bigint =(25 <untyped> bigint)
renderDescLen : untyped bigint =(60 <untyped> bigint)
services : map[string]*service_registry.Service Inspect
names : []string (len=5) Inspect
retired : map[string]*service_registry.Reservation Inspect
ownerServices : map[.uverse.address]int Inspect
pendingOwners : map[string].uverse.address Inspect
init.18 : func() Inspect
rejectStraySend : func() Inspect
quotaAdd : func(owner .uverse.address) Inspect
quotaDrop : func(owner .uverse.address) Inspect
assertQuota : func(owner .uverse.address) Inspect
isValidName : func(name string) bool Inspect
validatePkgPath : func(pkgPath string) Inspect
validateFields : func(description string, serviceType string, metadata string) Inspect
truncate : func(s string, n int) string Inspect
mustGet : func(name string) *service_registry.Service Inspect
RegisterService : func(name string, pkgPath string, description string, serviceType string, metadata string) Inspect
UpdateService : func(name string, pkgPath string, description string, serviceType string, metadata string) Inspect
TransferOwnership : func(name string, newOwner .uverse.address) Inspect
AcceptOwnership : func(name string) Inspect
CancelOwnershipTransfer : func(name string) Inspect
Deregister : func(name string) Inspect
Resolve : func(name string) string Inspect
TryResolve : func(name string) (string, bool) Inspect
GetOwner : func(name string) .uverse.address Inspect
GetPendingOwner : func(name string) string Inspect
ServiceCount : func() (count int, limit int) Inspect
OwnerServiceCount : func(owner .uverse.address) (count int, limit int) Inspect
GetService : func(name string) string Inspect
ListServices : func() string Inspect
ListByType : func(serviceType string) string Inspect
Render : func(path string) string Inspect