• Discover
  • Partner with us
  • Chapters
  • Blog

Learn everything about Polkadot and Substrate Development

Introduction to Polkadot

Relay chain, parachains and parathreads

Use cases

Pallets, Getting started with Polkadot Development

Introduction

More details on Substrate

Deep dive substrate

Internal Workings of Substrate

Installation

Building a blockchain

Simulating a complete substrate network

Adding trusted nodes to a network

Authorizing nodes in a network

Monitoring node metrics

Upgrading a running network

Building a Custom Pallet

Smart contracts

Prepare a Local relay chain

This tutorial demonstrates how to build a basic smart contract to run on a Substrate-based chain.

In this tutorial, you'll explore using ink! as a programming language for writing Rust-based smart contracts.

Install the CLI tool

We will first update our Rust environment -

  1. rustup component add rust-src
  2. Then verify whether we have the WebAssembly target installed - 
rustup target add wasm32-unknown-unknown --toolchain nightly

Now let’s go ahead and install the CLI tool -

  • Add rust-src compiler component -
rustup component add rust-src
  • Install the latest version of cargo-contract - 
cargo install --force --locked cargo-contract --version 2.0.0-rc
  • Verify the installation and explore the commands available - 
cargo contract --help

Create a new smart contract project

Here we are assuming that you already have a precompiled substrate node install

To generate files for an ink! Project - 

  1. Create a new project folder named “flipper” - cargo contract new flipper
  2. You will see a project generated with the default contract lib.rs
  3. Now we can test this smart contract with - Cargo Test
  4. Now we will build it - Cargo build

Deploy contract

Now that we have compiled the contract, we just need to start the node and deploy it

  • Start your node using 
substrate-contracts-node --log info,runtime::contracts=debug 2>&1
  • Go to the flipper project folder.
  • Build the contract using cargo contract build.
cargo contract instantiate --constructor new --args "false" --suri //Alice --salt $(date +%s)

Interact with contract

Since the smart contract has been deployed, let’s interact with it - 

  • We will first use get()
cargo contract call --contract $INSTANTIATED_CONTRACT_ADDRESS --message get --suri //Alice --dry-run
  • Then we will use flip()
cargo contract call --contract $INSTANTIATED_CONTRACT_ADDRESS --message flip --suri //Alice

Submission

Submit your work to complete this lesson.

Join the project workspace to share your solution and receive feedback.

Previous
Next

Lesson discussion

Swap insights and ask questions about “Learn everything about Polkadot and Substrate Development”.

Enroll to participate
Start the course to unlock the discussion. Enrolling helps us keep conversations relevant to learners.
WebsiteDiscoverPartner with UsBlogEvents
Discover
CoursesCircleRustSoliditySolanaWeb3 FundamentalsBlockchain Basics
CompanyAbout UsBrand GuidelineFAQsTerms of UsePrivacy PolicyGDPR NoticeCookies
Don't miss any update!

Disclaimer: The information, programs, and events provided on https://risein.com is strictly for upskilling and networking purposes related to the technical infrastructure of blockchain platforms. We do not provide financial or investment advice, nor do we make any representations regarding the value, profitability, or future price of any blockchain or cryptocurrency. Users are encouraged to conduct their own research and consult with licensed financial professionals before engaging in any investment activities. https://risein.com disclaims any responsibility for financial decisions made by users based on the information provided here.

© 2026 Rise In, All rights reserved