Step-by-Step Guide to Setting Up Sui and Walrus Storage on Mainnet and Testnet

AshwinAshwin
4 min read

Introduction

This comprehensive guide walks you through the installation and configuration of SUI blockchain and Walrus storage protocol on both mainnet and testnet environments. Whether you're a developer looking to build on SUI or deploy decentralized storage solutions with Walrus, this guide provides step-by-step instructions for getting your environment set up correctly.

Part 1: SUI Installation

Step 1: Download SUI Binary

Download the latest SUI binary from the official GitHub repository:

bash

# Visit https://github.com/MystenLabs/sui/releases
# Download the appropriate binary for your system

Step 2: Extract the Binary

Unzip the downloaded binary file to your desired location:

bash

tar -xvf sui-binary-*.tar.gz

Step 3: Configure PATH Environment

Add the SUI directory to your system PATH:

bash

echo 'export PATH=$PATH:~/sui' >> ~/.bashrc
source ~/.bashrc

Step 4: Initialize SUI Client

Trigger the directory configuration and generate a keypair:

bash

sui client envs

This command will:

  • Set up the directory structure for testnet/mainnet configuration

  • Generate a keypair with type 0

Important:

  • Press Enter to default to testnet during configuration

  • For mainnet deployment, provide the mainnet URL: https://fullnode.mainnet.sui.io:443

Part 2: Walrus Installation

Step 1: Prepare PATH Environment

First, add the Walrus installation directory to your PATH:

bash

echo 'export PATH=$PATH:/root/.local/bin' >> ~/.bashrc
source ~/.bashrc

Step 2: Install Walrus

Install Walrus using the official installation script:

For Mainnet:

bash

curl -sSf https://install.wal.app | sh

For Testnet:

bash

curl -sSf https://docs.wal.app/setup/walrus-install.sh | sh -s -- -n testnet

Step 3: Update PATH (if needed)

Ensure the PATH is correctly set:

bash

echo 'export PATH="/root/.local/bin:$PATH"' >> /root/.bashrc
source /root/.bashrc

Step 4: Create Configuration Structure

Set up the required directory structure:

bash

mkdir -p ~/.config/walrus
cd ~/.config/walrus

Step 5: Download Configuration File

Download the client configuration:

bash

curl https://docs.wal.app/setup/client_config.yaml -o ~/.config/walrus/client_config.yaml

Configuration: Testnet vs Mainnet

The client_config.yaml file contains configurations for both testnet and mainnet. Here's the complete configuration structure:

Configuration File Structure

yaml

contexts:
  mainnet:
    system_object: 0x2134d52768ea07e8c43570ef975eb3e4c27a39fa6396bef985b5abc58d03ddd2
    staking_object: 0x10b9d30c28448939ce6c4d6c6e0ffce4a7f8a4ada8248bdad09ef8b70e4a3904
    subsidies_object: 0xb606eb177899edc2130c93bf65985af7ec959a2755dc126c953755e59324209e
    exchange_objects: []
    wallet_config:
      path: ~/.sui/sui_config/client.yaml
      active_env: mainnet
    rpc_urls:
      - https://fullnode.mainnet.sui.io:443

  testnet:
    system_object: 0x6c2547cbbc38025cf3adac45f63cb0a8d12ecf777cdc75a4971612bf97fdf6af
    staking_object: 0xbe46180321c30aab2f8b3501e24048377287fa708018a5b7c2792b35fe339ee3
    subsidies_object: 0xda799d85db0429765c8291c594d334349ef5bc09220e79ad397b30106161a0af
    exchange_objects:
      - 0xf4d164ea2def5fe07dc573992a029e010dba09b1a8dcbc44c5c2e79567f39073
      - 0x19825121c52080bb1073662231cfea5c0e4d905fd13e95f21e9a018f2ef41862
      - 0x83b454e524c71f30803f4d6c302a86fb6a39e96cdfb873c2d1e93bc1c26a3bc5
      - 0x8d63209cf8589ce7aef8f262437163c67577ed09f3e636a9d8e0813843fb8bf1
    wallet_config:
      path: ~/.sui/sui_config/client.yaml
      active_env: testnet
    rpc_urls:
      - https://fullnode.testnet.sui.io:443

default_context: testnet

Switching Between Networks

  • For Testnet: The default configuration comes with default_context: testnet

  • For Mainnet: Change the last line to default_context: mainnet

Note: The default download typically comes configured for mainnet, so you may need to modify it for testnet use.

Funding Your Wallet

Step 1: Get Your SUI Address

bash

sui client active-address

Step 2: Fund Your Wallet

  • Testnet: Use the SUI Testnet Faucet

  • Mainnet: Purchase SUI tokens from supported exchanges

Step 3: Convert SUI to WAL (Testnet Only)

For testnet operations, convert your SUI tokens to WAL:

bash

walrus get-wal

Important: This command only works on testnet. For mainnet, you'll need to acquire WAL tokens through official channels.

Starting the Walrus Publisher Daemon

Step 1: Create Publisher Wallets Directory

bash

cd ~/.config/walrus
mkdir publisher-wallets

Step 2: Start the Daemon

Launch the Walrus publisher daemon with logging:

bash

walrus publisher \
  --bind-address 0.0.0.0:3111 \
  --sub-wallets-dir /root/.config/walrus/publisher-wallets \
  --n-clients 1 \
  --max-body-size 20971520 \
  > walrus.log 2>&1

Daemon Parameters Explained

  • --bind-address: The address and port where the daemon listens (0.0.0.0:3111)

  • --sub-wallets-dir: Directory for managing sub-wallets

  • --n-clients: Number of concurrent clients (1)

  • --max-body-size: Maximum upload size in bytes (20MB)

Troubleshooting

Common Issues

  1. Daemon Won't Start

    • Ensure you have sufficient SUI and WAL tokens

    • Check the walrus.log file for specific error messages

    • Verify all paths in configuration files are correct

  2. Path Not Found

    • Always run source ~/.bashrc after modifying PATH

    • Verify binary locations with which sui and which walrus

Health Checks

Verify your installation:

bash

# Check SUI installation
sui --version

# Check Walrus installation
walrus --version

# Check active network
sui client active-env

# Check wallet balance
sui client balance

Conclusion

You now have a fully configured SUI and Walrus environment ready for development or production use. Whether you're building on testnet or deploying to mainnet, this setup provides the foundation for interacting with the SUI blockchain and Walrus storage network.

Happy hacking on SUI and Walrus!

Checkout my links: ashwin0x.xyz

0
Subscribe to my newsletter

Read articles from Ashwin directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Ashwin
Ashwin

I'm a Full Stack Web3 Engineer crafting cutting-edge dApps and DeFi solutions. From writing secure smart contracts to building intuitive Web3 interfaces, I turn complex blockchain concepts into user-friendly experiences. I specialize in building on Ethereum, Sui, and Aptos — blockchain platforms where I’ve developed and deployed production-grade, battle-tested smart contracts. My experience includes working with both Solidity on EVM chains and Move on Sui and Aptos. I'm passionate about decentralization, protocol development, and shaping the infrastructure for Web3's future.