Sui is a next-generation blockchain platform that offers high throughput and low latency. To interact with it, you must connect to one of its available networks. This guide explains the different Sui networks and provides a step-by-step process for configuring your connection.
Sui provides three primary network options: Mainnet, Devnet, and Testnet. Additionally, you can run a local network on your own machine for development and testing purposes. The public Devnet and Testnet are ideal for experimenting with the latest features before they are deployed to Mainnet.
Available Sui Networks
Mainnet is the live production environment where real transactions occur. It is a stable network with genuine economic activity.
Devnet is a development network frequently updated by Mysten Labs. It is used for testing new features and APIs. Devnet is periodically reset.
Testnet is a more stable testing environment that mirrors Mainnet. It is also operated by Mysten Labs and is less frequently reset than Devnet.
Localnet is a network you can run on your personal computer. It is perfect for isolated development and testing without relying on external services.
The public Devnet and Testnet networks include infrastructure operated by Mysten Labs:
- Four validator nodes that process transactions.
- A public JSON-RPC endpoint for clients to send requests:
https://fullnode.testnet.sui.io:443(for Testnet) orhttps://fullnode.devnet.sui.io:443(for Devnet). - The Sui Explorer, a block explorer for viewing transaction history and network activity.
Obtaining Test Tokens
Test SUI tokens on Devnet and Testnet have no financial value. They are solely for testing smart contracts and performing transactions.
To acquire test tokens for Devnet or Testnet, you must request them through the official Discord channels:
- For Devnet: Use the
#devnet-faucetchannel. - For Testnet: Use the
#testnet-faucetchannel.
If you are running a Localnet, you can use a curl command to request tokens from your local faucet server. Mainnet does not have a faucet service.
It is also recommended to join the Discord #announcements channel for important updates regarding network status, upgrades, and resets.
👉 Explore more strategies for acquiring test assets
Essential Sui Tools
To interact with any Sui network, you will need the right tools. The Sui ecosystem provides several official utilities.
Sui Command Line Interface (CLI)
This is the primary tool for developers. The sui CLI allows you to:
- Create and manage wallet addresses and private keys.
- Publish Move modules and deploy smart contracts.
- Call functions within deployed Move packages.
- Transfer tokens and create example NFTs.
- Manage your client configuration for different networks.
Sui Explorer
This is a web-based block explorer. You can use it to:
- Look up transactions by their digest.
- Inspect objects and their ownership details.
- View network-wide metrics and validator information.
Prerequisites and Environment Setup
Before connecting to a network, you must set up your development environment.
- Install Sui: The first step is to install the Sui binaries on your machine. This provides you with the
suiCLI command. You can find the latest installation instructions in the official Sui documentation. - Get Test Tokens: As mentioned earlier, request test SUI tokens from the appropriate Discord faucet channel for the public network you are using (Devnet or Testnet). For a Localnet, use the local faucet.
To verify your installation was successful, open a terminal and run:
which suiThis command should return the filesystem path to the sui binary. If it returns sui not found, you need to revisit the installation steps.
Always check the official Sui GitHub Releases page to stay informed about the changes in each version and ensure your tools are compatible with the network you are targeting.
Configuring the Sui Client
The sui client command manages your client configuration, which is stored in a file called client.yaml. This file contains your active address, keypairs, and the RPC endpoints for different networks.
If you have previously created a Localnet using the sui genesis command, a client.yaml file was automatically generated for you, pre-configured to connect to your local RPC server at http://0.0.0.0:9000.
Initial Client Setup
If you do not have a client.yaml file (e.g., on a fresh installation), you need to create one by connecting to a network.
Run any sui client command, such as sui client addresses. The system will detect the missing config file and prompt you:
Config file ["/client.yaml"] doesn't exist, do you want to connect to a Sui Full node server [y/N]?Press y and then Enter.
You will then be prompted for the RPC server URL:
Sui Full node server URL (Defaults to Sui Devnet if not specified) :- To connect to the Devnet, simply press
Enter. - To use a custom URL (e.g., for Testnet, Mainnet, or a private node), enter the full URL (e.g.,
https://fullnode.testnet.sui.io:443) and pressEnter.
Next, you will be asked to provide an alias for this environment:
Environment alias for [ ]:Enter a memorable name like testnet or mainnet and press Enter.
Finally, you will be prompted to select a cryptographic scheme for your first keypair:
Select key scheme to generate keypair (0 for ed25519, 1 for secp256k1, 2 for secp256r1):Choose 0, 1, or 2 and press Enter. The client will generate a new keypair and display your new wallet address and a 12-word Secret Recovery Phrase. It is crucial to write down and securely store this recovery phrase, as it is the only way to restore access to this address.
Managing Multiple Network Connections
You can configure your client to easily switch between multiple networks (e.g., Localnet, Devnet, Testnet).
To view all currently configured environments and see which one is active, use the command:
sui client envsThe output will list the aliases and their corresponding RPC URLs, marking the active one.
localnet => http://0.0.0.0:9000 (active)
devnet => https://fullnode.devnet.sui.io:443To add a new environment alias for a custom RPC endpoint, use the new-env command:
sui client new-env --alias <alias-name> --rpc <rpc-url>Replace <alias-name> with a name like testnet and <rpc-url> with the appropriate endpoint.
To switch the active network, use the switch command:
sui client switch --env <alias-name>Replace <alias-name> with the name of the environment you want to use.
If you encounter persistent configuration issues, you can reset your environment by deleting the Sui config directory (~/.sui/sui_config/) and starting the configuration process again. Always ensure you have your recovery phrases backed up before doing this.
👉 Get advanced methods for managing wallet security
Frequently Asked Questions
What is the difference between Sui Devnet and Testnet?
Devnet is a more fluid network used for initial testing of brand-new features; it is reset often. Testnet is a more stable network that closely mimics the Mainnet environment and is used for final-stage testing before mainnet deployment; it experiences fewer resets.
I lost my secret recovery phrase. Can I recover my wallet?
No. The secret recovery phrase is the only way to restore access to your wallet addresses and the assets controlled by its private keys. It is impossible to recover a wallet without its phrase. Always store it securely offline.
Can I use the same address on Devnet, Testnet, and Mainnet?
Technically, yes, as an address is just a derivation from a public key. However, your address and its state (objects, coins) are unique to each network. The SUI tokens on Devnet and Testnet are valueless and separate from valuable Mainnet SUI.
Why can't I connect to the RPC endpoint?
Connection issues can be caused by an outdated Sui client version, an incorrect RPC URL, or temporary downtime on the network itself. First, verify your URL is correct and check the official Discord announcement channel for any known network outages.
How do I get real SUI tokens for Mainnet?
Real SUI tokens for use on the Mainnet must be purchased from a reputable cryptocurrency exchange. They cannot be obtained from a faucet.
Is running a local network necessary for development?
While not strictly necessary, running a Localnet is highly recommended. It allows you to develop and test your smart contracts instantly without waiting for Devnet transactions or being affected by network resets.