cns

작성자: convex-dev

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

convex-dev의 다른 스킬

account
convex-dev
Convex 계정을 생성하거나 조회합니다. 사용자가 새 계정을 설정하거나, 계정 세부 정보를 확인하거나, 키를 관리하려 할 때 사용하세요.
build-convex
convex-dev
소스에서 Convex 프로젝트를 빌드합니다. 기여자가 Convex를 컴파일, 테스트 또는 패키징하려는 경우 사용합니다.
cad3-encoding
convex-dev
CAD3 인코딩 형식 — 셀, 임베디드 vs 분기 참조, 값 ID, 유효성 규칙. 인코더, 디코더, 직렬화, 해싱 작업 시 사용하거나…
cad-reference
convex-dev
Convex 아키텍처 문서(CAD)의 색인으로, Convex에 대한 규범적 사양입니다. 프로토콜을 변경하기 전에 어떤 CAD가 하위 시스템을 관장하는지 찾는 데 사용하세요.
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 생태계에서의 방향 안내 — 어떤 리포지토리에 무엇이 있는지, 사양과 문서가 어디에 있는지, 그리고 어떤 클라이언트 라이브러리가 존재하는지. 컨텍스트가 필요할 때 사용하세요…