Installing required tools
Before running your first smart contract on Phron, you will first need to prepare your computer for development in Rust and ink!. Here's a handy guide to get you started.
Last updated
Before running your first smart contract on Phron, you will first need to prepare your computer for development in Rust and ink!. Here's a handy guide to get you started.
Last updated
The first thing you need to do before you can deploy your first smart contract on the Phron Testnet is to prepare your computer for development in Rust and ink!.
This guide uses installer and the rustup
tool to manage the Rust toolchain. It's the default way of installing Rust and we highly recommend doing it that way. However, if you prefer a different method, please check the "Other installation methods" section on the official .
To install and configure rustup
enter the following commands in your shell:
Now you have the latest stable version of Rust installed on your computer. For the development of smart contracts you will need a slightly more recent nightly
version, together with some additional components:
Rust comes with its native package manager cargo
which is also used for compiling Rust code. Make sure cargo
is installed correctly and visible in your shell environment:
ink! is an (EDSL) that can be used to write WASM smart contracts in Rust. In other words, ink! is a collection of "add-ons" on top of Rust that modify the behavior of the language to produce, instead of regular binary code that can be executed by your computer, special WASM code compatible with Substrate-based smart contracts execution environment. Ultimately, every ink! smart contract is just a normal Rust program with a tiny bit of additional ink!-specific headers called "macros".
To start using ink! you first need to install the binaryen
package, which is used to optimize the WebAssembly bytecode of the contract. Most likely binaryen
is available from your default package manager:
With binaryen
present you can install cargo contract
:
cargo contract
is an add-on to cargo
that extends it with commands helpful in the development of smart contracts. You can check what can be done with it by invoking cargo contract --help
. We will very soon use it to create our very first ink! smart contract.
You can also directly download a .