Rust & Cargo
A pre-requisite for compiling smart contracts is to install a stable Rust
version and cargo.
curl https://sh.rustup.rs -sSf | sh
CLI tool
- Pop
- cargo-contract
Use the Pop CLI for ink! smart contract development with the greatest developer experience.
Via Homebrew:
brew install r0gue-io/pop-cli/pop
Or Source:
cargo install --force --locked pop-cli
Then set up your environment:
pop install
Install cargo-contract, a CLI tool for setting up and managing smart contracts written with ink!. To install cargo-contract, run the following command in your terminal:
rustup component add rust-src
cargo install --force --locked --version 6.0.0-beta cargo-contract
In addition to Rust, installation requires a C++ compiler that supports C++17. Modern releases of gcc and clang, as well as Visual Studio 2019+ should work.
Looking to run the ink! linter locally? Follow the steps in the linter setup guide.
ink-node
For Pop CLI users, Pop automatically manages the local node for you.
For cargo-contract users, the ink-node is a simple Polkadot SDK blockchain with smart contract functionality. It's a comfortable option for local development and testing.
There are two ways of installing the node:
(1) Download the Binary
Go to the ink-node releases page. Under Assets of the latest release, download the appropriate binary for your platform:
- Linux (ARM64):
ink-node-linux-arm64.tar.gz - Linux (x86):
ink-node-linux.tar.gz - macOS:
ink-node-mac-universal.tar.gz
Make the binary executable:
chmod +x ./ink-node
For macOS users:
When you first try to run ink-node, macOS may show a security warning.
To allow the binary to run:
- Click the question mark (?) icon at the right top corner of the warning.
- Follow the Apple instructions that appear.
- Try running
ink-nodeagain and click "Open Anyway" when prompted.
To confirm that ink-node is working correctly, run:
./ink-node --version
If you see version information, your installation is successful!
(2) Build it yourself
Alternatively, you can build the node by yourself. This can take a while though!
The build instructions and pre-requisites can be found here.