Skip to main content

πŸš€ Developer Guide

Master the art of building fully on-chain applications with Dubhe Engine

Prerequisites: Basic knowledge of blockchain concepts and TypeScript/JavaScript programming

What is Dubhe Engine?

πŸ—οΈ Core Architecture

Dubhe uses the Entity Component System (ECS) pattern - the same architecture powering AAA game engines like Unity DOTS and Unreal Engine

Entities

Unique identifiers for objects in your application world

Components

Data containers that store entity attributes and state

Systems

Logic processors that transform component data
ECS provides several advantages for on-chain applications:
  • Performance: Data-oriented design optimizes for cache efficiency
  • Flexibility: Mix and match components to create complex behaviors
  • Modularity: Systems are independent and composable
  • Scalability: Easily handle thousands of entities

πŸ’» Development Workflow

1

Design Your Schema

// dubhe.config.js
export default {
  schemas: {
    components: [
      {
        name: "PlayerComponent",
        fields: {
          health: "u64",
          level: "u8",
          experience: "u64",
          name: "string"
        }
      },
      {
        name: "InventoryComponent", 
        fields: {
          items: "vector<ItemId>",
          capacity: "u32"
        }
      }
    ]
  }
}
2

Generate Move Contracts

Use the CLI to generate type-safe Move code:
dubhe generate
3

Implement Systems

Write game logic in Move:
public entry fun level_up(player: &mut PlayerComponent) {
    assert!(player.experience >= required_exp(player.level), EInsufficientExp);
    player.level = player.level + 1;
    player.experience = 0;
}
4

Build Frontend

Connect your UI with the TypeScript client:
const playerData = await client.getComponent({
  entity: playerId,
  component: 'PlayerComponent'
});

await client.tx.player_system.level_up({ player: playerId });

Key Features

Define your application’s data structure with schemas that automatically generate Move contracts and TypeScript types.
Built-in subscriptions keep your frontend synchronized with on-chain state changes in real-time.
Entity Component System design enables scalable, maintainable game logic that can handle complex interactions.
All game state and logic runs on-chain, ensuring transparency, composability, and true ownership.

Getting Started

Choose your path based on your experience:

Quick Start

New to Dubhe? Start here with a simple example project.

Contract Tutorial

Learn to build Move contracts step-by-step.

Client SDK

Integrate Dubhe with your frontend application.

DubheOS Platform

Explore the blockchain operating system.

Community and Support

Discord

Join our developer community

GitHub

Contribute to the project

Examples

See example applications
Ready to build? Follow our Quick Start guide to create your first Dubhe application in minutes.