Skip to content

polkadot-developers/polkadot-cookbook

Repository files navigation

Polkadot Polkadot
Dot CLI Dot CLI

Polkadot Cookbook

Practical, tested recipes for Polkadot SDK development

Browse RecipesContribute a RecipeDocumentation


License Polkadot Cookbook SDK CLI


Recipes

The Polkadot Cookbook provides recipes across 5 pathways of Polkadot development:

Runtime Development (Polkadot SDK)

Build custom FRAME pallets and runtime logic with Rust.

Recipe Description Difficulty
Basic Pallet Create a custom FRAME pallet with storage and events Beginner

Smart Contracts (Solidity)

Deploy and interact with Solidity contracts.

Recipe Description Difficulty
Simple Counter A simple counter smart contract in Solidity Beginner

Basic Interactions

Single-chain transaction submission and state queries with PAPI.

Recipe Description Difficulty
Coming soon Balance transfers, batch operations, proxy calls -

XCM (Cross-Chain Messaging)

Asset transfers and cross-chain communication with Chopsticks.

Recipe Description Difficulty
Teleport Assets Teleport assets between parachains using XCM v5 and PAPI Beginner

Testing Infrastructure

Zombienet and Chopsticks configurations for network testing.

Recipe Description Difficulty
Coming soon Parachain test network, fork testing setups -

Want to share your knowledge? See Contributing a Recipe


Quick Start

Run a Recipe

Each recipe is self-contained with working code and tests. Commands vary by recipe type:

Polkadot SDK (Rust)

cd polkadot-cookbook/recipes/basic-pallet
cargo test              # Run tests
cargo build --release   # Build the pallet

Smart Contracts (Solidity)

cd polkadot-cookbook/recipes/simple-counter
npm install            # Install dependencies
npm run compile        # Compile contracts
npm test              # Run tests

Cross-Chain (XCM)

cd polkadot-cookbook/recipes/teleport-assets
npm install           # Install dependencies
npm test             # Run tests with Chopsticks

Tip: Check each recipe's README.md for specific instructions.

Contribute a Recipe

Install the CLI Tool

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/polkadot-developers/polkadot-cookbook/master/install.sh | bash

Windows users: Download pre-built binaries from GitHub Releases. See Advanced Installation Options for details.

Advanced Installation Options

Manual download (all platforms):

Download pre-built binaries from GitHub Releases:

# Linux (x86_64)
curl -L https://github.com/polkadot-developers/polkadot-cookbook/releases/latest/download/dot-linux-amd64.tar.gz | tar xz
sudo mv dot /usr/local/bin/

# macOS (Apple Silicon)
curl -L https://github.com/polkadot-developers/polkadot-cookbook/releases/latest/download/dot-macos-apple-silicon.tar.gz | tar xz
sudo mv dot /usr/local/bin/

# macOS (Intel)
curl -L https://github.com/polkadot-developers/polkadot-cookbook/releases/latest/download/dot-macos-intel.tar.gz | tar xz
sudo mv dot /usr/local/bin/

# Windows
# Download dot-windows-amd64.exe.zip from releases, extract, and add to PATH

Build from source:

Requires Rust installed.

git clone https://github.com/polkadot-developers/polkadot-cookbook.git
cd polkadot-cookbook
cargo build --release --bin dot
# Binary will be at ./target/release/dot (or dot.exe on Windows)

Custom install location:

# Set INSTALL_DIR before running the installer
export INSTALL_DIR="$HOME/bin"
curl -fsSL https://raw.githubusercontent.com/polkadot-developers/polkadot-cookbook/master/install.sh | bash

Use the CLI

# Create a new recipe (interactive mode)
dot recipe create

# Test your recipe
dot recipe test my-pallet

# Submit your recipe as a pull request
dot recipe submit my-pallet

The CLI supports five recipe pathways:

  • Runtime Development - Build custom FRAME pallets with Rust
  • Smart Contracts - Deploy Solidity contracts
  • Basic Interactions - Single-chain transactions with PAPI (TypeScript)
  • XCM - Cross-chain messaging with Chopsticks (TypeScript)
  • Testing Infrastructure - Zombienet and Chopsticks configurations

See CONTRIBUTING.md for the complete guide.


Documentation

For Recipe Contributors

For Tool Users

  • CLI Tool - Command-line tool for creating recipes
  • SDK Library - Programmatic API for tool developers

For Maintainers


Contributing

We welcome all contributions:

  • Recipe - Share your Polkadot knowledge (most welcome!)
  • Bug Report - Help us improve
  • Feature - Suggest tooling improvements
  • Documentation - Make things clearer

See CONTRIBUTING.md to get started.


License

MIT OR Apache-2.0


About

Practical, tested recipes for Polkadot SDK development

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 5