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

# Building Robust Move + TypeScript Workflows 🛠️✨
Compiling, Testing, and Continuous Integration for Sui Developers Problem: You can write Move smart contracts and a TypeScript frontend, but getting them to work together in a clean, automated workflow is messy. You probably juggle between CLI commands, manual builds, and fragile test setups — which makes bugs slip into production. 😩
Goal: Build a deterministic pipeline where everything flows: ➡️ Compile Move packages → ✅ Run Move unit tests → 🔗 Run TypeScript integration tests → 🤖 Automate in CI/CD.
This guide shows you how to set up a bulletproof workflow for Move + TypeScript projects on Sui.
1) Local build and test flow ⚡
Before you even think about CI, you need a reliable local loop:
- Move compilation
sui move build --path ./move
- Compiles your Move modules.
- Produces bytecode + ABI → which your frontend/SDK consumes.
- Run Move unit tests
sui move test --path ./move
- Executes
#[test]
functions in your Move modules. - Great for logic validation without deploying.
- Export artifacts for frontend
- Keep outputs in
build/
orartifacts/
. - Your TypeScript SDK should always reference ABI from this build (not a stale copy).
👉 Local rule of thumb: Never commit frontend code pointing at an old ABI. Always recompile after Move changes.
2) TypeScript integration testing 🧑💻
Once Move logic compiles, test it end-to-end with your frontend:
- Add a testing framework:
npm i --save-dev jest ts-jest @types/jest
(or use Mocha if you prefer).
- Connect to local devnet or a dockerized testnet:
- CI can spin this up.
- Local devnet ensures deterministic state.
- Example test (Jest):
import { JsonRpcProvider, devnetConnection } from "@mysten/sui.js";
const provider = new JsonRpcProvider(devnetConnection);
test("fetch coin objects", async () => {
const objects = await provider.getOwnedObjects({ owner: "0x123..." });
expect(objects.length).toBeGreaterThanOrEqual(0);
});
- Use fixture accounts:
- Pre-fund them with devnet faucet or seed via CLI.
- Keeps tests reproducible.
💡 Tip: Write tests for both happy paths and error paths. Don’t just test “success” — test insufficient gas, invalid ownership, etc.
3) CI Setup (GitHub Actions Example) 🤖
Now let’s automate it! A minimal GitHub Actions pipeline:
name: CI
on: [push, pull_request]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install dependencies
run: npm ci
- name: Start Sui Devnet
run: sui start --background
- name: Build Move
run: sui move build --path ./move
- name: Run Move tests
run: sui move test --path ./move
- name: Run TS tests
run: npm test
✅ Steps:
- Install Node.js + Rust.
- Start local devnet.
- Build & test Move.
- Run TypeScript integration tests.
4) Determinism & caching ⚡🚀
CI should be fast and reliable. Speed it up with caching:
- Cache
node_modules
and Rust Cargo build artifacts. - Persist Move build artifacts between steps.
- Use GitHub’s built-in
actions/cache
for smarter caching.
👉 This avoids re-downloading and rebuilding everything on each push.
5) Troubleshooting tips 🛠️
Even with CI, things can break. Here’s a quick guide:
-
Node failing to start in CI → Bump resources, ensure ports aren’t already used.
-
ABI mismatch → Always generate frontend ABI from exact
sui move build
used in deploy. Don’t copy-paste. -
Flaky tests → Seed deterministic accounts, mock randomness where possible, isolate external dependencies.
-
Slow pipeline → Add caching layers, avoid reinstalling dependencies unnecessarily.
Final Thoughts 🌟
By following this flow, you get:
- Move logic tested in isolation ✅
- Frontend verified against real contracts 🔗
- Automated CI/CD that ensures every push is safe 🚦
The result? Confidence. Your contracts and dApps won’t break silently, and your team spends less time debugging “it works on my machine” problems. 🎯
- 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