In case you are looking for a guided tutorial directed towards beginners please check out our Guided Tutorial.
Rust & Cargo
A pre-requisite for compiling smart contracts is to have a stable Rust version and Cargo installed. Here's an installation guide.
The first tool we will be installing is
a CLI tool for helping setting up and managing WebAssembly smart contracts written with ink!.
The tool has a number of handy capabilities:
$ cargo contract
Utilities to develop Wasm smart contracts
Usage: cargo contract <COMMAND>
new Setup and create a new smart contract project
build Compiles the contract, generates metadata, bundles both together in a `<name>.contract` file
check Check that the code builds as Wasm; does not output any `<name>.contract` artifact to the `target/` directory
test Test the smart contract off-chain
upload Upload contract code
instantiate Instantiate a contract
call Call a contract
decode Decodes a contracts input or output data (supplied in hex-encoding)
help Print this message or the help of the given subcommand(s)
-h, --help Print help information
-V, --version Print version information
Please see the installation instructions in the
cargo-contract repository here.
If everything worked,
cargo contract --help should show you the above list of available commands.
The substrate-contracts-node is
a simple Substrate blockchain which is configured to include the Substrate module for
smart contract functionality – the
contracts pallet (see How it Works for more).
It's a comfortable option if you want to get a quickstart.
There are two ways of installing the node:
(1) Download the Binary
This is the recommended method, you can download a binary from our releases page (Linux and Mac).
(2) Build it yourself
Alternatively you can build the node by yourself. This can take quite a while though!
cargo install contracts-node