Published on

How to install Sui and Connect to Devnet

install-sui

Hi there! 👋

I just heard about Sui a few days ago, and these are my notes for learning for the first time. I installed Sui, connected to Sui Devnet, joined discord to get some faucet token, installed Sui Wallet and learned how to use wallet by trying to mint NFT.

What's Sui?

Sui is a Layer 1 blockchain written in Rust and supports smart contracts written in the Move

Sui: pronounced "sweet" without the "T" - with Transactions (loads of them), things are SWEET indeed. :-) - https://docs.sui.io/devnet/learn

Install Sui

Reference: https://docs.sui.io/devnet/build/install

Prerequisites:

  1. Homebrew
  2. curl - You can install with brew install curl
  3. Rust - You can install with Rustup

I install sui via Cargo

The easier way is to install it with brew (I already installed)

cargo install --locked --git https://github.com/MystenLabs/sui.git --branch "devnet" sui sui-gateway

The installation step is to take a couple of minutes after installed you can check it with this command:

sui --version

The output is: (As of the time of writing)

sui 0.10.0

Connect to Sui Devnet

Reference : https://docs.sui.io/devnet/build/devnet

sui client

This step will be generated like a your wallet (keypair)

Config file ["/Users/chai/.sui/sui_config/client.yaml"] doesn't exist, do you want to connect to a Sui RPC server [yN]?y
Sui RPC server Url (Default to Sui DevNet if not specified) :
Select key scheme to generate keypair (0 for ed25519, 1 for secp256k1):
0
Generated new keypair for address with scheme "ed25519" [0x0000000000000000000000000000000]
Secret Recovery Phrase : [your twelve words will appear here your twelve words will appear here]

If you already have sui config file, you can configure RPC server URL to Devnet by using:

sui client switch --rpc https://gateway.devnet.sui.io:443

If you forget your sui address, you can run this command:

sui client active-address

Sui Wallet

Reference : https://docs.sui.io/devnet/explore/wallet-browser

Sui Wallet is a chrome extension, you can install like a Metamask (create a new wallet or import an existing wallet)I import from keypair that I already set up in the previous step.

When the wallet is created, there is no Sui token. We can request faucet token (Yes, it's Devnet, you can't request free money on Mainnet 🤣)

  1. Join Sui Discord
  2. Go to channel devnet-faucet
  3. Type a command !faucet <address>
  4. Back to your wallet and you will see your Sui balance.
  5. Play around with Sui Explorer see your transaction detail.

Create NFT

You have 2 options to create NFT.

  1. Create via Sui Wallet, Go to Apps tab and click Mint an NFT
  2. Create with sui client command:
sui client create-example-nft

and you also can easily customize the name, description, or image :

sui client create-example-nft --url=https://devahoy.com/static/images/avatar.png --description="This is Chai" --name="Chai"

Here is my result : https://explorer.devnet.sui.io/objects/0x0240ab3b816f00c4d0fe31272b3cbcac93c22346

Further reading

Authors