Skip to content

GPTutor/sui-move-annotation

Repository files navigation

sui-move-annotation README

Annotate .move file by sui-move-analyzer.

Execute the script using the command

FILE_PATH="YOUR_MOVE_FILE" OUTPUT_FILE_PATH="YOUR_OUPUT_PATH" npm run test

Alt text

To prepare the training data for Sui-Move language, you may use this script to convert move code to annotated move code.

Execute the script of this repo to convert Sui-move code to annotated sui-move code for future training.

image

Set up for server

You may use it as API by running the following command:

npm run server

Then go to https://localhost:3000/api/docs to see the API document

Example Demo API https://move-annotate-backend.gptutor.tools/api/docs

image

How to execute at MacOS?

1. Install Cargo and Sui Move Analyzer following this tutorial

2. Install dependencies

npm install

3. Initialize Sui Move

Execute the following command to download the necessary dependencies. These dependencies will be accessible to the Sui-Move-Analyzer. In case you need the Sui-Move analyzer to recognize modules from other sources, like Bucket Protocol's Entry functions, you should modify the Move.toml at ./move_env_for_api. Specifically, you can add the desired module under this file's [dependencies] section.

cd move_env_for_api && sui move test

4. Execute

FILE_PATH="YOUR_MOVE_FILE" OUTPUT_FILE_PATH="YOUR_OUPUT_PATH" npm run test

How to install at the Ubuntu server?

1. install xvfb-run

sudo apt-get update
sudo apt-get install -y xvfb

2. Install Cargo and Sui Move Analyzer following this tutorial

3. Install Sui-Cli following this tutorial

4. Execute the sui code to install sui library

cd move_env_for_api && sui move test

5. Install dependencies

npm install
  1. Initialize Sui Move

Execute the following command to download the necessary dependencies. These dependencies will be accessible to the Sui-Move-Analyzer. In case you need the Sui-Move analyzer to recognize modules from other sources, like Bucket Protocol's Entry functions, you should modify the Move.toml at ./move_env_for_api. Specifically, you can add the desired module under this file's [dependencies] section.

cd move_env_for_api && sui move test
  1. Execute the convertsion
FILE_PATH="INPUT" OUTPUT_FILE_PATH="OUTPUT" xvfb-run npm run test

Limitation and Future Works:

The current API only supports single-threading, as it cannot execute multiple VS Code Tests simultaneously. Future versions will change to have a VS Code instance constantly running in the backend. A database like Redis will be used to store and manage tasks temporarily. As long as there are tasks, this Extension will automatically execute them to maximize the speed of concurrent execution.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published