Setup
On this page we describe the pre-requisites for working with ink!.
Use the Pop CLI for ink! smart contract development with the greatest developer experience.
Rust & Cargo
A pre-requisite for compiling smart contracts is to install a stable Rust
version (>= 1.85) and cargo
. Please see the official Rust installation guide.
- cargo-contract
- Pop
cargo-contract
The first tool we will be installing is cargo-contract
,
it is a CLI tool for setting up and managing smart contracts written with ink!. To install cargo-contract
, run the following command in your terminal:
cargo install --locked --git https://github.com/use-ink/cargo-contract
Make sure you have the latest stable version of Rust installed:
rustup update stable
ink-node
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-node
again 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.