LogoLogo
WebsiteSubstrate Block ExplorerEVM Block ExplorerFaucet
  • Learn
    • Architecture
    • Staking
      • Proof of stake
    • Smart Contracts
    • Accounts
    • Infrastructure
      • Nodes
      • Agents
      • Models
      • IPFS
    • Security
      • OPOC
      • TSS
      • IPFS Integrity
      • Model Updates Integrity
    • Fees
    • Finney Testnet RPC Endpoints
  • Build
    • Address format
    • ink! Environment
    • Wasm Smart Contracts
      • Smart Contract Stack
      • Domain-Specific Languages (DSLs)
      • ink! Development
      • ask! Development
      • Basic ink! Contract
    • EVM Smart Contracts
      • Introduction to EVM Smart Contracts
      • HardHat
      • Your first EVM Smart Contract
      • Debug EVM Transactions
      • Precompiles
        • SR25519
        • Substrate ECDSA
        • XC20
    • Run a node
      • Run an archive node
        • Binary
      • Run a full node
      • Become a validator
        • Learn about Validators
        • Validator requirements
        • Spin up a validator
        • Set your identity
    • Build an Agent
      • Introduction
      • Development
      • Installing WASP
      • Agents API Reference
      • Available AI Models
Powered by GitBook
On this page
  • Overview
  • What is ink!?
  • Setting Up Your Environment
  • Development Container
  • Additional Resources
Export as PDF
  1. Build

ink! Environment

PreviousAddress formatNextWasm Smart Contracts

Last updated 3 months ago

Overview

This guide will help you set up your environment for ink! and Wasm smart contract development in UOMI.

ℹ️ Note Before proceeding, make sure your system meets the requirements for Rust development.

What is ink!?

ink! is a Rust-based eDSL (embedded Domain Specific Language) developed by Parity Technologies. It's specifically designed for creating smart contracts that work with Substrate's pallet-contracts.

Rather than creating a new programming language, ink! adapts Rust's capabilities for smart contract development.

💡 Tip Want to learn more about why ink! is a great choice for smart contract development? Check out the detailed benefits here.

Why WebAssembly?

Curious about the choice of WebAssembly for smart contracts? Find comprehensive

Setting Up Your Environment

1. Installing Rust and Cargo

and Cargo are essential prerequisites for Wasm smart contract development.

Linux and macOS

# Download and install
curl https://sh.rustup.rs -sSf | sh

# Configure environment
source ~/.cargo/env

Windows

2. Configuring Rust

Set up your Rust environment with these commands:

rustup default stable
rustup update
rustup update nightly
rustup component add rust-src
rustup component add rust-src --toolchain nightly
rustup target add wasm32-unknown-unknown --toolchain nightly

⚠️ Warning

[toolchain]
channel = "1.69.0"
components = [ "rustfmt", "rust-src" ]
targets = [ "wasm32-unknown-unknown" ]
profile = "minimal"

3. Installing ink! CLI

The primary tool you'll need is cargo-contract, a CLI tool for managing WebAssembly smart contracts.

Prerequisites

First, install binaryen for WebAssembly bytecode optimization:

Debian/Ubuntu
apt-get update
apt-get -y install binaryen
ArchLinux
pacman -S binaryen
macOS
brew install binaryen
Windows
Find binary releases at https://github.com/WebAssembly/binaryen/releases

Additional Dependencies

Install required linking tools:

cargo install cargo-dylint dylint-link

Installing cargo-contract

cargo install cargo-contract --force --locked

💡 Tip Use --force to ensure you get the latest version. For a specific version, add --version X.X.X

Example for specific version:

cargo install cargo-contract --force --version 1.5.1

Explore available commands with:

cargo contract --help

Development Container

🔧 Alternative Setup Skip manual installation by using our pre-configured development container.

Find detailed instructions for using our dev container in the swanky-dev-container Github repository.

Additional Resources

Visit the and follow the Windows installation instructions.

Due to a bug in cargo-contract, building contracts with rust nightly 1.70.0 or higher will fail. It is advised to use rustc v1.69.0 or older until the issue is resolved from cargo-contract side. For better dev experience it is advised to create a in the root of your project directory with following values.

See more

explanations here.
Rust
Rust website
rust-toolchain file
here
ink! GitHub Repository
Official Documentation
Dev Container Guide