Install Cargo L1X

Install Dependencies

Please make sure to install dependencies based on OS version for smooth cargo installation.

Install Cargo

Cargo is the package manager for Rust. To install Cargo, use the command below.

curl https://sh.rustup.rs -sSf | sh

This command downloads and runs the Rustup installer script, which includes Cargo along with the Rust compiler and other tools necessary for Rust development.

Install cargo l1x plugin

This command fetches the Cargo plugin from the crates.io repository and installs it locally, enabling you to use the cargo l1x commands for managing L1X-specific tasks and projects within your Rust development environment.

cargo install cargo-l1x --force

Create Project

You can create a new project named "project_name" within the current directory.

cargo l1x create project_name

Build Project

Navigate to the project directory to build the project.

cd project_name
cargo l1x build

This command triggers the build process defined for the project, compiling the source code, resolving dependencies, and generating the executable or output specified by the project configuration. It ensures that the project is ready for execution or deployment, verifying that it compiles without errors and functions as intended.

The contract object file is created as the output of this command, at the location target/l1x/release/<l1x_contract.o> in cargo.

Clean Project

Resets the project directory to its initial state, removing any generated files or temporary artifacts, ensuring a fresh start for development.

cargo clean

Last updated