Basic Commands
Overview of CLI Commands
The cargo-stylus
command-line interface (CLI) is a crucial tool for developing, verifying, and deploying Arbitrum Stylus smart contracts written in Rust. Below are some common commands and their usage:
Creating a New Stylus Project
To start a new Stylus project, use the following command. This clones a local copy of a starter project:
For a minimal setup, you can use:
Checking Your Project
To ensure your project is valid and can be deployed on the Arbitrum network, use:
This command performs various checks on your contract to ensure it meets all requirements.
Deploying Your Project
To deploy your compiled smart contract to the Arbitrum network, use:
Replace <PRIVKEY_FILE_PATH>
with the path to your private key file.
Other Useful Commands
cargo stylus export-abi
: Export the ABI (Application Binary Interface) for your contract.cargo stylus replay
: Replay a transaction for debugging purposes.cargo stylus trace
: Trace a transaction to inspect its execution.
By mastering these commands, you can effectively manage the lifecycle of your Stylus smart contracts from development to deployment.
Last updated