🔧 What Powers Dubhe Engine: Key Components & Functions
Dubhe Engine's architecture consists of two major parts:
On-chain modules 🧱 and off-chain tools 🧰, each containing several core components that collectively support fully on-chain applications:
🧠 Harvard Architecture
Dubhe adopts the ''Harvard architecture''design philosophy, completely separating contract logic from state data.
On-chain, System Modules carry business logic while Schema Modules handle data storage, each serving their specific functions.
This modular separation improves code maintainability and extensibility.🛠️
📊 Schema Data Storage
Schema is Dubhe's native on-chain structured storage abstraction, similar to Move's ORM layer.
Developers use declarative Schema definitions ✍️ instead of manually writing Move resource structures, with tools automatically generating corresponding storage contracts.
Schema stores on-chain data in clear, intuitive structures and supports relational mapping for easy querying and management.🔍
⚙️ System Contract Modules
System modules are Move contract logic written by developers, focusing on business implementation.
They import libraries generated by Schema and call provided storage and event interfaces to implement specific application functions.
For example, in gaming applications, system modules contain game rules and operational logic 🎮,while Schema stores game state (character attributes, items, etc.) for system modules to read and write.
🚀 Move Execution Environment
All on-chain parts of Dubhe run on the underlying blockchain's Move virtual machine.
For example, on the Sui network, Dubhe-generated contracts are executed as ordinary Move modules by Sui Move VM, enjoying Move language security checks (resource model, type safety, etc.) and underlying chain parallel execution optimizations.
This ensures Dubhe contract logic complies with consensus and execution rules across all chains, maintaining security and consistency.🧾✅
🖥️ Dubhe CLI Tools
Dubhe provides command-line toolchain covering the entire process from project initialization to deployment testing.
Developers can create complete Dubhe project templates (including Move contracts and frontend frameworks) with a single command.
CLI supports Schema code generation (dubhe schemagen), local network startup (start:localnet), and other functions,dramatically reducing project setup time ⏱️ (from days to hours).
Additionally, CLI covers contract publishing, migration, and other operations, facilitating hot updates and data migration for contract logic.🔧📦
📡 Dubhe Indexer
Indexer is Dubhe's real-time indexing solution for on-chain data.
Currently on Sui, Dubhe Indexer synchronizes on-chain data to local SQLite databases, supporting complex Schema relationship indexing and real-time state update notifications.
It adopts event-driven architecture to efficiently process blockchain events, providing high-performance query capabilities and ensuring timely access to on-chain data for applications (data availability).
For real-time applications like games, Indexer enables frontends to quickly obtain on-chain state changes, improving user experience.⚡🔍
📦 Dubhe SDK Client Libraries
Dubhe provides type-safe client SDKs for multiple development languages (currently mainly TypeScript).
The SDK encapsulates interfaces for interacting with on-chain contracts and local indexed data, allowing developers to conveniently call on-chain functions or query on-chain state in frontend applications.
SDK automatically generates type definitions based on Schema, ensuring data structures and types obtained are consistent with on-chain, reducing tedious JSON parsing and assembly work.🧾🧠
Through SDK, DApp frontends can read on-chain data (provided via Indexer) and send transactions to call system contracts, achieving complete frontend-backend interaction loops.🔁
🌐 Multi-chain Support Modules
Dubhe's design has multi-Move ecosystem compatibility capabilities.
Architecturally, through modular encapsulation, specific implementation details for different chains are provided by respective packages.
For example, Dubhe provides separate NPM packages for Sui, Aptos, Rooch, Initia, and other chains (such as @0xobelisk/sui-cli, @0xobelisk/sui-indexer, @0xobelisk/aptos-client, etc.),ensuring consistent development experience across different chain environments.
This vendor-lock-free multi-chain support allows developers to deploy and run their Move applications on any Move-compatible chain, maximizing code and design reuse. 🚀🔄
🧰 Summary
The above components work together to form Dubhe Engine's complete development stack.
Overall, Dubhe provides developers with a one-stop solution from on-chain contract frameworks to off-chain toolchains, making building composable, scalable on-chain applications simpler and more efficient.✅