Setting up a project
⚠️ Legacy (Dubhe v1). This section uses the old
schemas/schema:genAPI and does not reflect Dubhe v2 (resourceswithDappStorage/UserStorage). For the current workflow, start with the Quick Start. Kept for reference pending a rewrite.
If you run pnpm create dubhe now, you will be shown some options to facilitate project creation:
We are working on Sui Move Contract development tutorial, so select the Sui and Contract tabs.
➜ pnpm create dubhe
Downloading registry.npmjs.org/create-dubhe/0.0.11: 8.98 MB/8.98 MB, done
../Library/pnpm/store/v3/tmp/dlx-54343 | +149 +++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
Content-addressable store is at: /Library/pnpm/store/v3
Virtual store is at: ../Library/pnpm/store/v3/tmp/dlx-54343/node_modules/.pnpm
../Library/pnpm/store/v3/tmp/dlx-54343 | Progress: resolved 149, reused 146, downloaded 3, added 149, done
✔ Input your projectName. … dubhe-template-project
✔ Pick your chain. › sui
✔ Pick your platform. › Contract
============================================================
🎉 Project creation successful!
📁 Project location: /Project/dubhe-template-project
------------------------------------------------------------
Next steps:
cd dubhe-template-project
pnpm install
============================================================Sample Dubhe project
A simple project creation wizard will ask you some questions. After that, the wizard will create some directories and files and install the necessary dependencies.
The initialized project has the following structure:
contracts
dubhe.config.ts
package.json
tsconfig.jsonThese are the default paths for a Dubhe project.
- contracts/: This directory contains the contracts of the project.
- dubhe.config.ts: This file contains the configuration of dubhe.
Setting up your editor
cd dubhe-template-project && pnpm install
code .