In case you are looking for a guided tutorial directed towards beginners please check out our Guided Tutorial.
A pre-requisite for compiling smart contracts is to have Rust and Cargo installed. Here's an installation guide.
The first tool we will be installing is
cargo-contract, a CLI tool for helping setting up and managing WebAssembly smart contracts written with ink!.
As a pre-requisite for the tool you need to install the binaryen package, which is used to optimize the WebAssembly bytecode of the contract.
If there's only an old version in your distributions package manager you can also download a binary release directly.
After you've installed the package execute:
cargo install cargo-contract --vers ^0.14 --force --locked
--force to ensure you are updated to the most recent
You can then use
cargo contract --help to start exploring the commands made available to you.
With ink! you can write smart contracts for blockchains built on Substrate.
Follow the official installation steps from the Substrate Developer Hub Knowledge Base to set up all Substrate pre-requisites. Once you have done this you will also need to run:
rustup component add rust-src --toolchain nightlyrustup target add wasm32-unknown-unknown --toolchain nightly
It's a comfortable option if you want to get a quickstart.
cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --tag v0.1.0 --force --locked