Skip to content

polkadot-developers/polkadot-cookbook

Repository files navigation

Polkadot Polkadot
Dot CLI Dot CLI

Polkadot Cookbook

Practical, tested recipes for building on Polkadot

Build runtime logic, smart contracts, dApps, and cross-chain applications with working code examples.

Browse RecipesContribute a RecipeDocumentation


License Polkadot Cookbook SDK CLI


Recipes

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

Pallets

Build custom parachains with FRAME pallets, runtime logic, and PAPI integration testing.

Recipe Description
parachain-example Full parachain development environment with 12+ pallets, custom logic, and TypeScript tests
pallet-example Pallet-only development (no runtime) for advanced users

Contracts

Deploy and interact with Solidity smart contracts on Polkadot parachains.

Recipe Description
contracts-example Template for Solidity contracts with Hardhat and deployment scripts

Transactions

Single-chain transaction submission and state queries using the Polkadot API.

Recipe Description
transaction-example Template for chain interactions with Polkadot API (TypeScript)

XCM

Cross-chain asset transfers and messaging between parachains.

Recipe Description
cross-chain-transaction-example Template for XCM messaging with Chopsticks local testing

Networks

Testing infrastructure with Zombienet and Chopsticks for local network development.

Recipe Description
network-example Template for Zombienet and Chopsticks network configurations

Note: Example recipes are auto-generated by our integration tests to ensure templates stay fresh and validated. They are regenerated regularly to match the latest Rust version and dependencies.

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:

Pallets - Full Parachain (Rust + TypeScript/PAPI)

cd polkadot-cookbook/recipes/pallets/parachain-example
cargo test              # Run pallet unit tests
npm run build:runtime   # Build parachain runtime
npm run start:node      # Start local node
npm test                # Run PAPI integration tests

Pallets - Pallet Only (Rust)

cd polkadot-cookbook/recipes/pallets/pallet-example
cargo test              # Run pallet unit tests

Contracts (Solidity)

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

Transactions (TypeScript)

cd polkadot-cookbook/recipes/transactions/transaction-example
npm install           # Install dependencies
npm test             # Run tests

XCM (TypeScript)

cd polkadot-cookbook/recipes/cross-chain-transactions/cross-chain-transaction-example
npm install           # Install dependencies
npm test             # Run tests with Chopsticks

Networks (TypeScript)

cd polkadot-cookbook/recipes/networks/network-example
npm install           # Install dependencies
npm test             # Run tests

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 project (interactive mode)
dot create

# Test your project
dot test my-pallet

# Submit your project as a recipe to the cookbook
dot submit my-pallet

The CLI supports five project pathways:

  • Smart Contract - Build, test, and run Solidity smart contracts
  • Parachain - Build a full parachain with custom pallets and PAPI integration
  • Chain Transactions - Single-chain transactions and state queries with PAPI
  • Cross-Chain Transactions - Cross-chain asset transfers and cross-chain calls with Chopsticks
  • Polkadot Networks - Run a Polkadot network locally with Zombienet or Chopsticks

See CONTRIBUTING.md for the complete guide.


Documentation

For Recipe Contributors

For Developers

For Maintainers

  • Regenerating Example Recipes - Example recipes are auto-generated by integration tests:
    cargo test --package cli --test pathway_integration_tests -- --ignored
    This creates fresh examples in recipes/*-example/ that validate templates work with the current Rust version and dependencies.
  • Integration tests run automatically on:
    • Releases
    • Weekly schedule
    • PRs touching rust-toolchain.toml or templates

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