Engine
Docs
Prerequisites

Prerequisites

Before we begin let’s make sure your local environment is setup with the proper prerequisites.

Node Environment

  1. node.js (v18.16.0+) (download (opens in a new tab))
  2. pnpm (after installing node: npm install --global pnpm)

If you are using Windows:

Windows steps

  1. install git bash (gitforwindows.org)
  2. install nodejs, including “native modules” (nodejs.org/en/download) (re native modules: just keep the checkmark, it’s enabled by default in the installer)

Sui Binaries

There are two main approaches for obtaining Sui:

  1. Installation:

    1. If you are running on a Unix machine (Linux/macOS), then the simplest option is to download the latest binary.

    2. You can also install via Cargo.

  2. Alternatively, build Sui directly from source.

Download or compile the Sui binaries and configure them in the global environment, our CLI will use sui and sui-test-validator.

(Method 1) Install by downloading

Simply head to the GitHub Releases (opens in a new tab) page and download the latest version of Sui binary matching your platform:

  • macOS arm64: sui-RELEASE_VERSION-macos-arm64.tgz
  • macOS x86: sui-RELEASE_VERSION-macos-x86_64.tgz
  • Linux: sui-RELEASE_VERSION-ubuntu-x86_64.tgz
  • Windows: sui-RELEASE_VERSION-windows-x86_64.tgz

If you are using macOS/Linux:

The step-by-step instruction below should carry you through the whole process:

  1. Make the directory where we'll place the binary:

    mkdir -p $HOME/.sui/bin
  2. Extract the binary archive:

    tar -C $HOME/.sui -vxzf $ARCHIVE_NAME && mv $HOME/.sui/target/release/* $HOME/.sui/bin && rm -rf $HOME/.sui/target
  3. Rename binary:

    # sui-test-validator-($platform) for example: sui-test-validator-macos-arm64; sui-($platform) for example: sui-macos-arm64
    mv $HOME/.sui/bin/sui-test-validator-($platform) $HOME/.sui/bin/sui-test-validator && mv $HOME/.sui/bin/sui-($platform) $HOME/.sui/bin/sui
  4. Update your path, by adding this line in your .bashrc or .zshrc shell configuration file:

    export PATH="$HOME/.sui/bin:$PATH"

NOTE: The binary may be initially prevented from running if you're on macOS. See the "Open Anyway" instructions from this support forum (opens in a new tab) if that is the case.

If you are using Windows:

Please unzip $ARCHIVE_NAME and configure sui and sui-test-validator in it to the global environment.

(Method 2) Build from source

  1. Clone the repository

    Open a terminal and clone the sui repository:

    git clone https://github.com/MystenLabs/sui.git

    Change to the repository directory

    cd sui
  2. Checkout the latest release

    Go to the sui releases (opens in a new tab) page to see what is the most recent release.

    Then checkout the release, for example if the most recent release is testnet-v1.9.0 then execute the command:

    git checkout testnet-v1.9.0
  3. Building with cargo build

    This command builds all the crates from the sui repository, namely: sui, sui-test-validator, sui-faucet etc.

    cargo build --release

    When using Obelisk, we only need to use sui and sui-test-validator, so they need to be configured into the global environment.

    # Place the compiled binary in the global environment.
    sudo mv target/release/sui target/release/sui-test-validator /usr/local/bin

Finally, Verify that the binary was installed successfully.

sui --version