
# Interact with 0G Chain Contracts ## Metadata - **Category**: chain - **SDK**: `ethers` ^6.13.0 - **Activation Triggers**: "call contract", "read contract", "interact", "write contract", "contract function" ## Purpose Read from and write to deployed smart contracts on 0G Chain using ethers v6. Covers view functions, state-changing transactions, event listening, and gas estimation. ## Prerequisites - Node.js >= 18 - `ethers` ^6.13.0 installed - Contract ABI and address - `.env` with `PRI
# Provider Discovery ## Metadata - **Category**: compute - **SDK**: `@0glabs/0g-serving-broker` ^0.6.5, `ethers` ^6.13.0 - **Activation Triggers**: "list providers", "find provider", "verify provider", "TEE", "available models" ## Purpose Discover, filter, and verify compute providers on the 0G network. List available services by type (chatbot, text-to-image, speech-to-text), check TEE verification status, and acknowledge providers before first use. ## Prerequisites - Node.js >= 22 - `@0
# Upload File to 0G Storage ## Metadata - **Category**: storage - **SDK**: `@0glabs/0g-ts-sdk` ^0.3.3, `ethers` ^6.13.0 - **Activation Triggers**: "upload file", "store on 0G", "ZgFile", "save to storage" ## Purpose Upload files to 0G decentralized storage using the ZgFile API and Indexer. Files are split into chunks, organized as a Merkle tree, and distributed across storage nodes. Returns a root hash for later retrieval. ## Prerequisites - Node.js >= 18 - `@0glabs/0g-ts-sdk` and `ethers`
# Account Management ## Metadata - **Category**: compute - **SDK**: `@0glabs/0g-serving-broker` ^0.6.5, `ethers` ^6.13.0 - **Activation Triggers**: "deposit", "transfer funds", "refund", "check balance", "account balance" ## Purpose Manage funds across the 0G Compute Network's dual-account system: Main Account (receives deposits) and Provider Sub-Accounts (one per provider, funds locked for that provider's services). ## Prerequisites - Node.js >= 22 - `@0glabs/0g-serving-broker` and `ether
# Compute + Storage Integration ## Metadata - **Category**: cross-layer - **SDK**: `@0glabs/0g-serving-broker` ^0.6.5, `@0glabs/0g-ts-sdk` ^0.3.3, `ethers` ^6.13.0 - **Activation Triggers**: "AI with storage", "generate and store", "transcribe and store", "inference with storage", "AI pipeline" ## Purpose Combine 0G Compute (AI inference) with 0G Storage for end-to-end AI pipelines: generate content with AI and persist results to decentralized storage, or load data from storage and process
# Merkle Verification ## Metadata - **Category**: storage - **SDK**: `@0glabs/0g-ts-sdk` ^0.3.3 - **Activation Triggers**: "verify file", "merkle proof", "data integrity", "root hash", "check file" ## Purpose Compute root hashes and verify data integrity for files stored on 0G Storage. Uses Merkle tree proofs to cryptographically verify that downloaded data matches what was originally uploaded. ## Prerequisites - Node.js >= 18 - `@0glabs/0g-ts-sdk` installed ## Quick Workflow 1. Create
# Scaffold 0G Project ## Metadata - **Category**: chain - **SDK**: `ethers` ^6.13.0, `@0glabs/0g-ts-sdk` ^0.3.3, `@0glabs/0g-serving-broker` ^0.6.5 - **Activation Triggers**: "new project", "scaffold", "initialize", "create 0G app", "setup project" ## Purpose Initialize a new 0G dApp project with the correct SDK versions, TypeScript configuration, environment setup, and boilerplate code for storage, compute, and/or chain interactions. ## Prerequisites - Node.js >= 18 - npm or pnpm ## Quic
# Streaming Chat Inference ## Metadata - **Category**: compute - **SDK**: `@0glabs/0g-serving-broker` ^0.6.5, `ethers` ^6.13.0 - **Activation Triggers**: "chatbot", "inference", "LLM", "DeepSeek", "streaming chat", "AI chat" ## Purpose Run conversational AI inference using 0G Compute Network providers. Supports streaming and non-streaming modes with models like DeepSeek V3.1, Qwen, Gemma, and GPT-OSS. ## Prerequisites - Node.js >= 22 - `@0glabs/0g-serving-broker` and `ethers` installed - F
# Speech-to-Text Transcription ## Metadata - **Category**: compute - **SDK**: `@0glabs/0g-serving-broker` ^0.6.5, `ethers` ^6.13.0 - **Activation Triggers**: "transcribe", "speech-to-text", "Whisper", "audio transcription" ## Purpose Transcribe audio files using 0G Compute Network providers running Whisper Large V3. Supports multiple audio formats and output types (JSON, text, SRT subtitles). ## Prerequisites - Node.js >= 22 - `@0glabs/0g-serving-broker` and `ethers` installed - Funded and
# Text-to-Image Generation ## Metadata - **Category**: compute - **SDK**: `@0glabs/0g-serving-broker` ^0.6.5, `ethers` ^6.13.0 - **Activation Triggers**: "generate image", "text-to-image", "Flux", "image generation", "create image" ## Purpose Generate images from text prompts using 0G Compute Network providers running Flux Turbo. Supports multiple resolutions and batch generation. ## Prerequisites - Node.js >= 22 - `@0glabs/0g-serving-broker` and `ethers` installed - Funded and acknowled
# Storage + Chain Integration ## Metadata - **Category**: cross-layer - **SDK**: `@0glabs/0g-ts-sdk` ^0.3.3, `ethers` ^6.13.0 - **Activation Triggers**: "on-chain reference", "NFT metadata on 0G", "store hash on-chain", "registry contract", "chain and storage" ## Purpose Combine 0G Storage with 0G Chain smart contracts to create on-chain references to off-chain data. Common patterns include NFT metadata storage, content registries, and verifiable document systems. ## Prerequisites - Node
# Download File from 0G Storage ## Metadata - **Category**: storage - **SDK**: `@0glabs/0g-ts-sdk` ^0.3.3, `ethers` ^6.13.0 - **Activation Triggers**: "download file", "retrieve from 0G", "get file", "fetch from storage" ## Purpose Download and verify files from 0G decentralized storage using a root hash. Supports verified downloads with Merkle proof validation to ensure data integrity. ## Prerequisites - Node.js >= 18 - `@0glabs/0g-ts-sdk` installed - Root hash of the file to download - `
# Model Fine-Tuning ## Metadata - **Category**: compute - **SDK**: `@0glabs/0g-serving-broker` ^0.6.5 (CLI-based workflow) - **Activation Triggers**: "fine-tune", "train model", "custom model", "model training" ## Purpose Fine-tune AI models on 0G's distributed GPU network. Upload training data, configure parameters, monitor training, and download the resulting model. **Currently testnet only.** ## Prerequisites - Node.js >= 22 - `@0glabs/0g-serving-broker` CLI installed globally - Testnet
# Deploy Contract to 0G Chain ## Metadata - **Category**: chain - **SDK**: `ethers` ^6.13.0, Hardhat or Foundry - **Activation Triggers**: "deploy contract", "Solidity", "0G Chain", "deploy smart contract" ## Purpose Deploy Solidity smart contracts to 0G Chain using Hardhat, Foundry, or ethers v6 directly. All contracts must be compiled with `evmVersion: "cancun"`. ## Prerequisites - Node.js >= 18 - Hardhat or Foundry installed - Funded wallet with 0G tokens - `.env` with `PRIVATE_KEY`, `R