2. How to use Sui IDE

The process of writing, testing, compiling, deploying, interacting, and querying with Sui smart contracts

1. Write a contract

Upon entering the project, the README.md file included in the folder will be automatically previewed.

In the Explorer panel, you can create new files (or folders), refresh the directory, and download files. You can also directly click on the files that come with the template.

Click on a contract file to edit the code.

2. Test a contract

Once your contract code is written, click on the "Compiler" button in the right-side menu to open the compilation module. After selecting the Module Package Path, click on "Test."

After a successful test, the test results will be displayed in the console.

3. Compile a contract

On the right-hand menu bar, under the Compiler section, click on "Build" to start compiling the contract.

After a successful compilation, a "build.json" file will be generated in the current directory.

4. Connect to Sui

Before deploying the contract, you need to click on "Connect Wallet" on the upper right corner. Choose from one of the available wallets to connect it to ChainIDE.

5. Deploy a contract

Click the "Deploy & Interaction" button on the right-hand side, which will bring up the deployment and interaction pages. Select the compiled contract and click "Deploy" to initiate the deployment (then confirm in Wallet). After successful contract deployment, the console will display the contract deployment result and relevant information.

In addition, you can click "Import Deployed Contract" to import a contract that has already been deployed for contract interactions.

6. Contract interaction

After a successful contract deployment, you can interact with the contract. Click on the deployed contract, choose the corresponding interface, and click on "Execute" to initiate the write interaction.

7. Package & Object Query

Click on "Account Objects" and enter the corresponding fields to query the relevant information.

8. Sui Sandbox

If you prefer using the command line for development, you can open the Sui Sandbox, which comes pre-loaded with Sui Cli, Git and Node.js V16.

If you've started a process on a port in the Sandbox and wish to access that port, please refer to ChainIDE - Port Forwarding.

Last updated