Quickstart
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
API Documentation
Section titled “API Documentation”The API documentation for the lotus-script crate can be found here.
Development environment
Section titled “Development environment”We recommend using Visual Studio Code with rust-analyzer.
Install Rust and the wasm32 target
Section titled “Install Rust and the wasm32 target”To create a new project, you need to have Rust installed. If you don’t have it installed, you can install it from rustup.rs. After installing Rust, you need to install the wasm32 target. You can do this by running the following command:
rustup target add wasm32-unknown-unknownInstall lotus-sc
Section titled “Install lotus-sc”lotus-sc is a CLI tool that helps you develop scripts for LOTUS. You can download the installer from here. For more information, please refer to the lotus-sc documentation.
Create a new project
Section titled “Create a new project”lotus-sc create -n my-project -l rustFollow the instructions in the terminal to complete the project creation.
Edit the scripts.toml file to set the correct user and sub ids for the object the script should be attached to.
Deploy the script
Section titled “Deploy the script”lotus-sc deployThis will compile the script and put it in the correct directory for LOTUS to pick it up. You need to restart the simulator if it is running while you deploy for an object for the first time. All following deploys will be hot-reloaded.
Release builds
Section titled “Release builds”lotus-sc deploy --releaseDebugging
Section titled “Debugging”To debug your script in LOTUS, press F4 to open the debug menu. In the debug menu, activate script-debug.
This will open a new window where you can see some information about the script and the script state.
To close this window, deactivate script-debug in the debug menu.
Proper WASM debugging is not yet implemented.