2. How to use Sui IDE
The process of writing, testing, compiling, deploying, interacting, and querying with Sui smart contracts
Last updated
The process of writing, testing, compiling, deploying, interacting, and querying with Sui smart contracts
Last updated
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.
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.
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.
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.
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.
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.
Click on "Account Objects" and enter the corresponding fields to query the relevant information.
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.