Пост
Поделитесь своими знаниями.

Getting started with the Sui SDK — Environment, first project, and common pitfalls 🚀
Problem: You want to start building on Sui quickly but don’t know which SDK to pick, how to set up your environment, or how to create your first Move-backed app with a working local dev loop.
Goal: Give a clear, minimal, reproducible local setup, walk through a first TypeScript + Move project, and point out common pitfalls — with fixes — so you can ship confidently. ✨
1) Choose an SDK & language 🧭
- TypeScript / JavaScript — the go-to for dApp frontends and most tooling (RPC clients, transaction builders, wallet adapters).
- Rust — good for native tooling, CLI helpers, or backend components that need low-level control.
- Move — the smart-contract language used on Sui; you’ll write packages in Move and deploy them with the CLI.
Recommendation: If you’re building a user-facing dApp, start with TypeScript for the frontend and add Move modules for your on-chain logic. Use Rust only if you need native performance or tooling.
2) Pre-requisites (local machine) ✅
Make sure you have:
- Node.js LTS (≥ 18) and npm or yarn.
- Rust toolchain (
rustup
) — if you’ll compile Move packages or use Rust tooling. - Sui CLI (optional but recommended) — for local devnet, account management, build & publish of Move packages.
- A code editor like VS Code with Move & TypeScript extensions for syntax highlighting and linting.
Quick tip: keep node
, rust
, and sui
versions reasonably aligned — mismatched versions are a common source of friction.
3) Install Sui CLI (summary) ⚙️
On Unix-like systems (example pattern):
sh <(curl -sSL https://your-sui-install-script)
# then verify
sui --version
Use the official Sui repo install instructions when available. If the script doesn’t exist, follow the repo README to build from source.
4) Initialize a TypeScript dApp — minimal reproducible project 🧩
- Create project folder:
mkdir sui-dapp && cd sui-dapp
npm init -y
- Install the Sui TypeScript SDK:
npm i @mysten/sui.js
(Package name may vary with official registry — adjust if necessary.)
- Create
index.ts
:
import { JsonRpcProvider, devnetConnection } from "@mysten/sui.js";
const provider = new JsonRpcProvider(devnetConnection);
async function main(){
const version = await provider.getRpcApiVersion();
console.log("RPC version:", version);
}
main().catch(console.error);
- Run it with
ts-node
or compile withtsc
thennode
.
5) Use a local Sui network for fast feedback 🧪
- Start a local devnet with the Sui CLI (or use a community devnet). Local networks make iteration fast and deterministic.
- Create funded dev accounts using CLI commands or faucet scripts so you can sign and submit transactions while developing.
Why local devnet? Faster feedback loops, deterministic tests, and safe experimentation without spending real assets.
6) Common pitfalls & fixes — the quick troubleshooting guide 🛠️
Problem | Symptom | Quick Fix |
---|---|---|
Version mismatch | Transactions fail or RPC calls error | Align SDK & CLI versions; upgrade/downgrade to matching releases |
CORS / wallet connection | Wallet won’t connect in browser | Serve app on http://localhost ; confirm wallet supports chosen network |
Gas confusions | Reverts with “insufficient gas” | Include a gas coin object and set a sensible gas budget; simulate when possible |
Object ownership errors | Move reverts, “object not found” or “not owner” | Verify Move function signatures, input object refs, and ownership rules |
Missing artifacts/ABI mismatch | Frontend expects different types | Always use the ABI from the exact sui move build output used in deploy |
Extra troubleshooting tips
- Simulate transactions before asking users to sign (where SDK supports it).
- Emit events in Move to make runtime flows easier to debug from the frontend.
- Keep a mapping of Move abort codes → user-friendly messages for better UX.
7) Next steps — what to build after this guide 🔭
-
Create a minimal UI that:
- Connects to a wallet adapter,
- Signs a transaction,
- Displays owned objects and events.
-
Learn Move basics: modules, resources,
moveCall
semantics, and how to compile & publish withsui move build
/sui move publish
. -
Add tests:
sui move test
for Move unit tests and Jest/Mocha integration tests using a local devnet.
Quick checklist before you commit code ✅
- Node, Rust, and Sui CLI installed and versions checked
- Local devnet running and seeded with dev accounts
- Frontend using the ABI/artifacts from the exact build used in Move deployment
- Transaction flows simulate successfully locally
- Meaningful error messages mapped to Move aborts
- SDKs and Developer Tools
Sui is a Layer 1 protocol blockchain designed as the first internet-scale programmable blockchain platform.
Заработай свою долю из 1000 Sui
Зарабатывай очки репутации и получай награды за помощь в развитии сообщества Sui.

- 24p30p... SUI+2681
1
- Dpodium.js... SUI+2411
2
- Gifted.eth... SUI+2211
3
- ... SUIJeff+2205
- ... SUIJK spike+2175
- ... SUIcasey+2106
- ... SUIMatthardy+1777
- ... SUIjakodelarin+1040
- ... SUIChubbycheeks +888
- ... SUItolexwills47+783
- Почему BCS требует точного порядка полей для десериализации, когда структуры Move содержат именованные поля?65
- «Ошибки проверки нескольких источников» в публикациях модуля Sui Move — автоматическое устранение ошибок55
- Сбой транзакции Sui: объекты, зарезервированные для другой транзакции49
- Ошибка Sui Move — невозможно обработать транзакцию Не найдено действительных газовых монет для транзакции315
- Как максимизировать прибыль, держа SUI: стейкинг и ликвидный стейкинг212