# Setting up a Sui 💧 Development Environment in Linux

By [Crypto Trekker](https://paragraph.com/@crypto-trekker) · 2023-04-15

---

For an extended explanation, please check the great Sui docs [here](https://docs.sui.io/build/install).

Prerequisites
-------------

In a nutshell:

    curl, git-all, cmake, gcc, libssl-dev, pkg-config, libclang-dev,build-essential
    

Well, you know what to do: just apt them all, right?

Installing Sui Binaries
-----------------------

Use the following command to install Sui directly from the Sui GitHub repository (devnet branch):

    # Install
    cargo install --locked --git https://github.com/MystenLabs/sui.git --branch devnet sui
    # Update rust
    rustup update stable
    # Check sui
    sui
    

![Output of "sui" command](https://storage.googleapis.com/papyrus_images/1f8d83824bd11d06a23fa9cd15458f342184c8ec483d9e02ac16ec7f3e563790.png)

Output of "sui" command

Install vscode as IDE
---------------------

[https://code.visualstudio.com/download](https://code.visualstudio.com/download)

Next, install the move-analyzer extension:

![vscode extension move-analyzer](https://storage.googleapis.com/papyrus_images/8f5f5cf0cb417bc3f55d8f50d3517c5b6b7bf532b112d018cea4db941d118f36.png)

vscode extension move-analyzer

And the move language server:

    cargo install --git https://github.com/move-language/move move-analyzer --branch sui-move --features "address32"
    

You should be able to see Move code with syntax highlighting, commenting & uncommenting, simple context-unaware completion suggestions while typing, and other basic language features in Move files.

![Nice syntax highlight and other features provided by the Move Analyzer plugin](https://storage.googleapis.com/papyrus_images/fbbee19115154ce69996986285f3533da004c1d7c28d8d2aa4a1bae32f893652.png)

Nice syntax highlight and other features provided by the Move Analyzer plugin

Connect to Sui Devnet or Testnet
--------------------------------

To connect to the Sui devnet for the first time, just run sui client:

Choose: y, devnet, 0.

Save the address and secret recovery phrase just in case. Example from Sui documentation:

    # Result: keypar added to sui.keystore and seed phrase printed
    Generated new keypair for address with scheme "ed25519" [0xb9c83a8b40d3263c9ba40d551514fbac1f8c12e98a4005a0dac072d3549c2442]
    Secret Recovery Phrase : [cap wheat many line human lazy few solid bored proud speed grocery raise erode there idea inform culture cousin shed sniff author spare carpet]
    

Add testnet:

    sui client new-env --alias testnet --rpc https://fullnode.testnet.sui.io:443
    

List configured environments:

    sui client envs
    
    # Result: alias to the left, RPC endpoint to the right 
      devnet => https://fullnode.devnet.sui.io:443 (active)
      testnet => https://fullnode.testnet.sui.io:443
    

Switch active network:

    sui client switch --env testnet
    

> As `testnet` is usually comparatevily slow, it is better to use `devnet` for all developments. It is also possible to setup a local network, as described [here](https://docs.sui.io/build/sui-local-network) in the Sui docs.

Go Further with the Sui CLI
---------------------------

Get the active Sui client address:

    sui client active-address
    

Create a new address:

    # The Sui Wallet currently only allow importing PKs 
    # generate from ed25519. If you plan to import later 
    # the local address into the Sui wallet, use it.
    sui client new-address ed25519
    

List all created addresses:

Change active address:

    sui client switch --address YOUR_ADDRESS_HERE
    

List amount of gas for the active-address:

    # For a specific address just add it after gas
    sui client gas
    

Request gas from the Sui testnet faucet:

    curl --location --request POST 'https://faucet.testnet.sui.io/gas' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "FixedAmountRequest": {
            "recipient": "YOUR_ADDRESS_HERE"
        }
    }'
    

Request gas from the Sui devnet faucet:

    curl --location --request POST 'https://faucet.devnet.sui.io/gas' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "FixedAmountRequest": {
            "recipient": "YOUR_ADDRESS_HERE"
        }
    }'
    

List all objects owned by the active-address:

Get object detailed info:

    sui client object YOUR_OBJECT_ID_HERE
    

That’s it for today. If you enjoyed the content, consider `subscribing` and `collecting` this entry. Thank you!

PS. If you are interested in how to import your locally generated address into your Sui Wallet, check this article [here](https://mirror.xyz/0x2Be16a8DECf7c68739097904Ed6d2dc1070337d8/dU-XC7p5mQn5_5zNTw8QyC8RLV-w4PPMHacJWoRvsag).

[Subscribe](null)

---

*Originally published on [Crypto Trekker](https://paragraph.com/@crypto-trekker/setting-up-a-sui-development-environment-in-linux)*
