Langsung ke konten utama

Environment Setup

Install and Configure the Rust Toolchain

Install Rust by running the following shell commands:

# Install
curl --proto '=https' --tlsv1.2 -sSf | sh
# Configure
source ~/.cargo/env

Configure to the latest stable and add nightly + Wasm target

rustup default stable
rustup update
rustup update nightly
rustup component add rust-src
rustup component add rust-src --toolchain nightly
rustup target add wasm32-unknown-unknown --toolchain nightly

ink! contracts use nightly version of Rust, so you can also set up default to nightly (optional)

rustup default nightly

Install WebAssembly Compiler & Toolchain

Binaryen is a compiler and toolchain infrastructure library for WebAssembly. WebAssembly contracts development tools require Binaryen to be installed as a pre-requisite. It is available for various package managers, for example, Debian/Ubuntu, Arch Linux, Homebrew.

  • Using apt-get
apt-get update
apt-get -y install binaryen
  • Using apt
apt update
apt -y install binaryen

cargo-contract CLI

To build contracts, you will need to install cargo-contract. You can find the installation instructions here.