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アカウントを作成または確認します。ユーザーが新しいアカウントを設定したい場合、アカウントの詳細を確認したい場合、またはキーを管理したい場合に使用します。
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の規約、ライブラリコードの呼び出し、アクター定義、ジュースとエラーコード。CVMソースの作成やデバッグ時に使用。
deploy
convex-dev
アクター(スマートコントラクト)をConvexネットワークにデプロイします。エクスポートされた関数を持つ新しいオンチェーンアクターを作成したい場合に使用します。
ecosystem
convex-dev
Convexエコシステムにおけるオリエンテーション — どのリポジトリに何が含まれているか、仕様書とドキュメントがどこにあるか、どのクライアントライブラリが存在するか。コンテキストが必要なときに使用します…