cns

Разрешение или регистрация имен Convex Name System (CNS). Используется, когда пользователь хочет найти имя CNS, зарегистрировать новое имя или обновить цель имени.

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

Больше skills от convex-dev

account
convex-dev
Создание или проверка аккаунтов Convex. Используйте, когда пользователь хочет настроить новый аккаунт, проверить детали аккаунта или управлять ключами.
account
convex-dev
Создание или просмотр аккаунтов Convex. Используйте, когда пользователь хочет создать новый аккаунт, проверить детали аккаунта или управлять ключами.
token
convex-dev
Создание и управление взаимозаменяемыми токенами на Convex. Используйте, когда пользователь хочет создать новый токен, проверить балансы токенов или управлять эмиссией токенов.
build-convex
convex-dev
Собрать проект Convex из исходного кода. Используйте, когда участник хочет скомпилировать, протестировать или упаковать Convex.
convex-db
convex-dev
Используйте Convex DB — SQL-базу данных на основе решётки. Используйте, когда помогаете пользователям писать запросы, подключаться через JDBC или PostgreSQL-клиенты, создавать таблицы, вставлять/запрашивать данные,…
convex-lisp
convex-dev
Справочник по языку Convex Lisp — соглашения CVM, вызов библиотечного кода, определения акторов, коды juice и ошибок. Используйте при написании или отладке исходного кода CVM для…
deploy
convex-dev
Разверните актор (смарт-контракт) в сети Convex. Используйте, когда пользователь хочет создать новый ончейн-актор с экспортируемыми функциями.
ecosystem
convex-dev
Ориентация в экосистеме Convex — что находится в каком репозитории, где находятся спецификации и документация, и какие клиентские библиотеки существуют. Используйте, когда нужен контекст…