-
Install rustup. Once installed, make sure you have the wasm32 target:
rustup default stable rustup update stable rustup target add wasm32-unknown-unknown
-
Install wasm-opt:
cargo install wasm-opt --locked
, this produces a optimized version of the contract small enough to be uploaded to the chain. -
Install sedad
You can build a release version, but not optimized with cargo wasm
which outputs target/wasm32-unknown-unknown/release/seda_contract.wasm
.
If you want an optimized version of the wasm you can instead run cargo wasm-opt
which outputs to target/seda_contract.wasm
. This is the version you would want to upload to the chain.
You can build the json schema with cargo schema
.
rustfmt
is used to format any Rust source code, we do use nightly format features: cargo +nightly fmt
.
Nightly can be installed with: rustup install nightly
.
clippy
is used as the linting tool: cargo clippy -- -D warnings
Unit testing can be done with: cargo test
.
You could also install nextest, with cargo install cargo-nextest --locked
, then run cargo nextest
. Nextest is a faster test runner for Rust.
Not yet set-up again.
We use cargo xtask
to help automate lots of various actions.
It doesn't require any additional installations to use xtask
, its just a more rust-esque way of doing a Makefile
.
You can read more about xtask and it's benefits at that link.