cns

Resolver ou registrar nomes do Convex Name System (CNS). Use quando o usuário quiser consultar um nome CNS, registrar um novo nome ou atualizar o destino de um nome.

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.)

Mais skills de convex-dev

account
convex-dev
Criar ou inspecionar contas Convex. Use quando o usuário quiser configurar uma nova conta, verificar detalhes da conta ou gerenciar chaves.
build-convex
convex-dev
Compile o projeto Convex a partir do código-fonte. Use quando um contribuidor quiser compilar, testar ou empacotar o Convex.
cad3-encoding
convex-dev
Formato de codificação CAD3 — células, referências embutidas vs. de ramo, IDs de valor, regras de validade. Use ao trabalhar com codificadores, decodificadores, serialização, hashing ou…
cad-reference
convex-dev
Índice dos Documentos de Arquitetura Convex (CADs), as especificações normativas do Convex. Use para descobrir qual CAD rege um subsistema antes de alterar o protocolo...
convex-db
convex-dev
Use o Convex DB — um banco de dados SQL com suporte a lattice. Use ao ajudar usuários a escrever consultas, conectar via clientes JDBC ou PostgreSQL, criar tabelas, inserir/consultar dados,…
convex-lisp
convex-dev
Referência da linguagem Convex Lisp — convenções da CVM, chamada de código de biblioteca, definições de atores, códigos de juice e erro. Use ao escrever ou depurar código fonte da CVM para…
deploy
convex-dev
Implante um ator (smart contract) na rede Convex. Use quando o usuário quiser criar um novo ator on-chain com funções exportadas.
ecosystem
convex-dev
Orientação no ecossistema Convex — o que vive em qual repositório, onde estão as especificações e documentos, e quais bibliotecas cliente existem. Use quando precisar de contexto…