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

Skills เพิ่มเติมจาก convex-dev

convex-lisp
convex-dev
เอกสารอ้างอิงภาษา Convex Lisp — ข้อกำหนด CVM, การเรียกใช้โค้ดไลบรารี, นิยามแอ็กเตอร์, juice และรหัสข้อผิดพลาด ใช้เมื่อเขียนหรือดีบักซอร์ส CVM สำหรับ…
ecosystem
convex-dev
การปฐมนิเทศในระบบนิเวศ Convex — อะไรอยู่ใน repository ใด, เอกสาร spec และ docs อยู่ที่ไหน, และมี client libraries ใดบ้าง ใช้เมื่อคุณต้องการบริบท...
local-network
convex-dev
เรียกใช้เครือข่ายทดสอบ Convex ในเครื่องเพื่อการพัฒนา ใช้เมื่อทดสอบการเปลี่ยนแปลงกับเครือข่ายจริง จำลองปัญหาจากเพียร์ หรือเมื่อไม่มีเครือข่ายระยะไกล…
protocol-versions
convex-dev
โปรโตคอลเวอร์ชัน การย้ายข้อมูล และการอัปเกรด v1 — ควรเขียนตามความหมายใด และจะเปลี่ยนพฤติกรรมของ CVM ได้อย่างไรโดยไม่ต้องแยกเครือข่าย ใช้เมื่อ…
etch
convex-dev
ตรวจสอบและบำรุงรักษา Etch store — ฐานข้อมูลแบบ content-addressed ของ Convex ใช้เมื่อตรวจสอบพื้นที่จัดเก็บของ peer วินิจฉัยความเสียหายของข้อมูล การเก็บขยะ หรือ…
juice
convex-dev
การคิดบัญชี Juice — ต้นทุนของการคำนวณและแบนด์วิดท์บน CVM ใช้เมื่อพิจารณาเกี่ยวกับต้นทุนการดำเนินการธุรกรรม วินิจฉัยความล้มเหลว :JUICE หรือ…
trust
convex-dev
Trust monitors — โมเดลการอนุญาตบนเชนที่ประกอบได้ของ Convex ใช้เมื่อเขียนการควบคุมการเข้าถึง จำกัดฟังก์ชันของนักแสดง กำหนดว่าใครสามารถ mint หรือ…
memory
convex-dev
การบันทึกบัญชีหน่วยความจำและวงเงิน — ต้นทุนของการจัดเก็บข้อมูลบนเชน และวิธีลดและเรียกคืนต้นทุนดังกล่าว ใช้เมื่อพิจารณาเกี่ยวกับการเติบโตของสถานะ วิเคราะห์…