Compile a Rust smart contract module#
This guide will show you how to compile smart contract module written in Rust to a Wasm module.
Make sure to have Rust and Cargo installed and the
target, together with
cargo-concordium and the Rust source code for a smart
contract module, you wish to compile.
For instructions on how to install the developer tools see Install tools for development.
Compiling to Wasm#
In order to build a smart contract, run:
$cargo concordium build
This uses Cargo for building, but runs further optimizations on the result.
For building the schema for a smart contract module, some further preparation is required.
It is also possible to compile using Cargo directly by running:
$cargo build --target=wasm32-unknown-unknown [--release]
Note that even with
--release set, the produced Wasm module includes