deploy

작성자: convex-dev

Convex 네트워크에 액터(스마트 컨트랙트)를 배포합니다. 사용자가 내보낸 함수를 가진 새로운 온체인 액터를 생성하려 할 때 사용하세요.

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

Deploy a Convex Actor

Actors are autonomous on-chain programs with their own address, state, and callable functions.

See the convex-lisp skill for CVM conventions and error codes. Deploying is a transaction, so it needs a key the user has supplied — see transact.

Actor Structure

A typical actor deployment:

(deploy
  '(do
     ;; Internal state (private to the actor)
     (def counter 0)

     ;; Callable functions: mark each with ^:callable so it can be
     ;; invoked from outside the actor via (call ...)
     (defn ^:callable increment []
       (set! counter (+ counter 1))
       counter)

     (defn ^:callable get-count []
       counter)))

Key Rules

  • deploy returns the new actor's address (e.g. #12345)
  • Only functions tagged with ^:callable metadata can be called from outside (there is no export form). The equivalent map form is ^{:callable true}
  • Use set! to update an existing def from inside a function; plain defs declared in the actor body are private state
  • Actors have their own *address* and *balance*
  • Use (set-controller #ADDR) inside the actor to set who can upgrade it
  • deploy also accepts a vector of code forms, which is how library builders are composed into one actor: (deploy [(@convex.fungible/build-token {…}) (@convex.fungible/add-mint {…})])

After Deployment

  1. Note the returned address for the user
  2. Optionally register a CNS name: (*registry*/create 'my.actor.name #NEW-ADDR) — needs control of the parent namespace; see the cns skill
  3. Test by calling a ^:callable function: (call #NEW-ADDR (get-count))

Workflow

  1. Help the user design the actor based on $ARGUMENTS
  2. Write the Convex Lisp source
  3. Deploy using transact with the (deploy ...) expression
  4. Verify the deployment with a test query

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가 하위 시스템을 관장하는지 찾는 데 사용하세요.
cns
convex-dev
Convex Name System (CNS) 이름을 조회하거나 등록합니다. 사용자가 CNS 이름을 조회하거나, 새 이름을 등록하거나, 이름의 대상을 업데이트하려는 경우 사용하세요.
convex-db
convex-dev
Convex DB(래티스 기반 SQL 데이터베이스)를 사용하세요. 사용자가 쿼리를 작성하거나, JDBC 또는 PostgreSQL 클라이언트를 통해 연결하거나, 테이블을 생성하거나, 데이터를 삽입/조회할 때 도움이 필요할 때 사용하세요.
convex-lisp
convex-dev
Convex Lisp 언어 참조 — CVM 규칙, 라이브러리 코드 호출, 액터 정의, juice 및 오류 코드. CVM 소스를 작성하거나 디버깅할 때 사용합니다…
ecosystem
convex-dev
Convex 생태계에서의 방향 안내 — 어떤 리포지토리에 무엇이 있는지, 사양과 문서가 어디에 있는지, 그리고 어떤 클라이언트 라이브러리가 존재하는지. 컨텍스트가 필요할 때 사용하세요…