Sui Environment Setup
Before you start developing with Sui and Move, you should familiarize yourself with how to contribute to Sui, how Sui is structured, what tools and SDKs exist, and what plugins are available to use in your IDE.
Fork the Sui repository
The recommended way to contribute to the Sui repository is to fork the project, make changes on your fork, then submit a pull request (PR). The Sui repository is available on GitHub: https://github.com/MystenLabs/sui.
To create a local Sui repository:
-
Go to the Sui repository on GitHub.
-
Click the Fork button to create a copy of the repository in your account.
-
In your forked repository on GitHub, click the green
Code <>
button and copy the HTTPS URL GitHub provides. -
Open a terminal or console on your system at the location you want to save the repository locally. Type
git clone
and paste the URL you copied in the previous step and pressEnter
. -
Type
cd sui
to makesui
the active directory.
You can use any branching strategy you prefer on your Sui fork. Make your changes locally and push to your repository, submitting PRs to the official Sui repository from your fork as needed.
Be sure to synchronize your fork frequently to keep it up-to-date with active development.
Using Sui from command line
You can interact with the Sui network through two official SDKs (TypeScript SDK and Rust SDK), and by using the Sui CLI. For more details about using the Sui CLI, see Install Sui and the Sui CLI reference.
Move IDEs and plugins
The recommended IDE for Move development is Visual Studio Code with the move-analyzer
extension. Follow the Visual Studio Marketplace instructions to install the move-analyzer extension, then install the move-analyzer
language server:
cargo install --git https://github.com/MystenLabs/sui.git move-analyzer
See more IDE options in the Awesome Move documentation.
After you install VS Code and the move-analyzer
extension, check out the Move code examples.
To test or run a Move example on Sui, use the sui move
command from the Sui CLI.
Sui repository and how to contribute
The Sui repo is a monorepo, containing all the source code that is used to build and run the Sui network, as well as this documentation.
The root folder of the Sui monorepo has the following top-level folders:
- apps: Contains the source code for the main web applications that Mysten Labs runs,
Sui Wallet
. - crates: Contains all the Rust crates that are part of the Sui system.
- dapps: Contains some examples of decentralized applications built on top of Sui, such as Kiosk or Sponsored Transactions.
- dashboards: Currently empty.
- doc: Contains deprecated documentation related to Move and Sui.
- docker: Contains the docker files needed to spin up a node, an indexer, a Full node or other services.
- docs: Contains this documentation and the source for this site.
- examples: Contains examples of apps written for Sui and smart contracts written in Move.
- external-crates: Contains the source code for the Move programming language.
- kiosk: Contains the source code of the Mysten Labs Kiosk extensions and rules, as well as examples.
- narwhal: Contains the source code of Narwhal and partially synchronous Bullshark, a DAG-based mempool, and efficient BFT consensus.
- nre: Contains information about node and network reliability engineering.
- scripts: Contains a number of scripts that are used internally.
- sdk: Contains the source code for different tools and SDKs, such as the Sui TypeScript SDK, Kiosk SDK, BCS, zkLogin, dApp kit, and others.
- sui-execution: Contains the source code responsible for abstracting access to the execution layer.
The following primary directories offer a good starting point for exploring the Sui codebase:
- move - Move VM, compiler, and tools.
- narwhal - Mempool and consensus.
- typescript-sdk - the Sui TypeScript SDK.
- wallet - Chrome extension wallet for Sui.
- sui - the Sui command line tool.
- sui-core - Core Sui components.
- sui-execution - Execution Layer (programmable transactions, execution integration).
- sui-framework - Move system packages (0x1, 0x2, 0x3, 0xdee9).
- sui-network - Networking interfaces.
- sui-node - Validator and Full node software.
- sui-protocol-config - On-chain system configuration and limits.
- sui-sdk - The Sui Rust SDK.
- sui-types - Sui object types, such as coins and gas.
Development branches
The Sui repository includes four primary branches: devnet
, testnet
, mainnet
, and main
.
The devnet
branch includes the latest stable build of Sui. Choose the devnet
branch if you want to build or test on Sui Devnet. If you encounter an issue or find a bug, it may already be fixed in the main
branch. To submit a PR, you should push commits to your fork of the main
branch.
The testnet
branch includes the code running on the Sui Testnet network.
The mainnet
branch includes the code running on the Sui Mainnet network.
The main
branch includes the most recent changes and updates. Use the main
branch if you want to contribute to the Sui project or to experiment with cutting-edge functionality. The main
branch might include unreleased changes and experimental features, so use it at your own risk.