> For the complete documentation index, see [llms.txt](https://chainide.gitbook.io/chainide-english-1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chainide.gitbook.io/chainide-english-1/ethereum-ide-1/9.-sui-ide/2.-how-to-use-sui-ide.md).

# 2. How to use Sui IDE

{% embed url="<https://www.youtube.com/watch?v=5Pq_r5geNl0>" %}

## 1. Write a contract

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

<figure><img src="/files/OgFhMd2rmrqAOIfDCo7O" alt=""><figcaption></figcaption></figure>

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.

<figure><img src="/files/tvragwr9fvgQ2q5aNWXt" alt=""><figcaption></figcaption></figure>

Click on a contract file to edit the code.

<figure><img src="/files/iqrnCP6TEelHwTZ1ifyz" alt=""><figcaption></figcaption></figure>

## 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."

<figure><img src="/files/nkwLFBrLCiKFZYuYAHzQ" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/i5ovIcq3yCyfOyRogkMM" alt=""><figcaption></figcaption></figure>

## 3. Compile a contract

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

<figure><img src="/files/cPSeAOG6S2H1JthJW53Y" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/nMxtGRQWqIs27Ui84esO" alt=""><figcaption></figcaption></figure>

## 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.

<figure><img src="/files/23f0GlsEE7y4XcIbR34U" alt=""><figcaption></figcaption></figure>

## 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.

<figure><img src="/files/cOOyxDI5C00EN6yztjXv" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/NYhkVGIdGXg6u6CEqIxF" alt=""><figcaption></figcaption></figure>

## 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.

<figure><img src="/files/tyD2mAZBfF0FVVuYvFW1" alt=""><figcaption></figcaption></figure>

## 7. Package & Object Query

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

<figure><img src="/files/xUUHL8bnnVPf2cw73jaW" alt=""><figcaption></figcaption></figure>

## 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](https://docs.sui.io/references/cli), [Git](https://git-scm.com/) and [Node.js V16](https://nodejs.org/en).

<figure><img src="/files/oezum09Ciy9wQQo2Va9I" alt=""><figcaption></figcaption></figure>

If you've started a process on a port in the Sandbox and wish to access that port, please refer to [ChainIDE - Port Forwarding](/chainide-english-1/port-forwarding.md).
