cns

Resolver o registrar nombres del Convex Name System (CNS). Usar cuando el usuario quiera buscar un nombre CNS, registrar un nombre nuevo o actualizar el destino de un nombre.

npx skills add https://github.com/convex-dev/convex --skill cns

Convex Name System (CNS)

CNS maps human-readable names (like convex.fungible) to on-chain addresses.

See the convex-lisp skill for CVM conventions.

Resolve a Name

In CVM source, @convex.fungible resolves the name directly — this is the normal way to reach a library.

To inspect a name's record (value, controller, metadata, child node), use a Convex MCP server's resolveCNS tool if one is configured. Otherwise query it:

java -jar convex.jar client query '@convex.fungible'

Register or Update a Name

The registry actor is #9, available in CVM code as *registry*. It has no cns-update function — use create for a new name and update for an existing one:

;; Create a new name pointing at a target, with *address* as controller
(*registry*/create 'my.name #TARGET *address*)

;; Update an existing name you control
(*registry*/update 'my.name #NEW-TARGET)

;; Change who controls a name
(*registry*/control 'my.name #NEW-CONTROLLER)

These are transactions (they change state). Notes:

  • Creating requires controlling the parent namespace. (*registry*/create 'my.name ...) needs the my node to exist and to trust you — otherwise it fails with :TRUST "Forbidden to create CNS node". Top-level names require special authority.
  • create also accepts optional controller, metadata and child arguments: (*registry*/create 'my.name target controller metadata).
  • Note (*registry*/register {:name "..."}) is unrelated — it registers metadata for the caller's own account, not a CNS name.
  • The registry also defines change-control, but it is the scoped :callable SPI variant (path taken from *scope*) — not called directly with a symbol; use control.

CNS in Code

  • @convex.fungible in CVM source resolves to the actor address at runtime
  • Use CNS paths instead of hardcoded addresses for portable code
  • (@convex.fungible/balance #TOKEN #USER) calls balance on the resolved actor

Common CNS Names

NamePurpose
convex.fungibleFungible token standard library
convex.trustTrust and access control
convex.assetGeneric asset interface
asset.nft.simpleNon-fungible token standard
asset.multi-tokenMulti-token standard

(Resolve with (*registry*/resolve 'name) to get the current address — these are network-specific.)

Más skills de convex-dev

convex-lisp
convex-dev
Referencia del lenguaje Convex Lisp — convenciones de CVM, llamada a código de biblioteca, definiciones de actores, juice y códigos de error. Usar al escribir o depurar código fuente de CVM para…
ecosystem
convex-dev
Orientación en el ecosistema Convex: qué se encuentra en cada repositorio, dónde están las especificaciones y la documentación, y qué bibliotecas de cliente existen. Úsalo cuando necesites contexto…
local-network
convex-dev
Ejecuta una red de prueba local de Convex para desarrollo. Úsala al probar cambios contra una red en vivo, al reproducir un problema de un peer, o cuando no haya una red remota…
protocol-versions
convex-dev
Versiones de protocolo, migraciones y la actualización v1: qué semántica usar al escribir, y cómo cambiar el comportamiento de CVM sin bifurcar la red. Úsese cuando…
etch
convex-dev
Inspeccionar y mantener un almacén Etch — la base de datos direccionada por contenido de Convex. Úsalo al examinar almacenamiento de pares, diagnosticar corrupción, recolectar basura, o…
juice
convex-dev
Contabilidad de Juice: el costo de la computación y el ancho de banda en la CVM. Úselo al razonar sobre el costo de ejecución de transacciones, diagnosticar un error de :JUICE, o…
trust
convex-dev
Los monitores de Trust — el modelo de autorización componible en cadena de Convex. Úselo al escribir control de acceso, restringir funciones de actores, definir quién puede acuñar o…
memory
convex-dev
Contabilidad y asignaciones de memoria: el costo del almacenamiento en cadena y cómo minimizarlo y recuperarlo. Úsese al razonar sobre el crecimiento del estado, diagnosticar un…