Skip to content

scio-labs/inkathon

Repository files navigation

inkathon v6 Boilerplate (Alpha)

License: GPL v3 Built with ink! Rust TypeScript Next.js

Next generation full-stack boilerplate for ink! smart contracts running on PolkaVM. Powered by Papi, ReactiveDOT, Pop CLI, and more. – Perfect for kickstarting building hackathon projects.

Join the discussion in our Telegram Group 💬

About 📖

The inkathon boilerplate offers a complete setup for developing full-stack dApps on Polkadot with ink! smart contracts and Next.js. It now shines in new glory with full ink! v6 support powered by Papi, ReactiveDOT, Pop CLI, and more.

The boilerplate rebuild features:

  • Full ink! v6 support & type-safety
  • Revamped build, deployment, and address management scripts
  • Updated stack with Bun, Next.js v15, TailwindCSS & shadcn/ui v4

The inkathon boilerplate is almost as old as ink! itself. With accumulated over 200 stars, more than 250 public projects depending on it and the most active ink! Telegram group.

Note

The old ink! v5 compatible boilerplate is available on the v1 branch.

Getting Started 🚀

1. Run the frontend

Important

  • Setup Node.js v22 (recommended via nvm)
  • Install Bun
  • Clone this repository
# Executed from the root directory
bun run install

# Executed from the root or /frontend directory
bun run dev

2. Build & deploy contracts on a local node

Important

  • Setup your environment with Pop CLI: Guide
  • Install ink-node by downloading it's binary
  • Make ink-node available globally by moving it to /usr/local/bin
  1. Add your contract (or just continue with the provided flipper example)
  2. Build your contract
# Executed from the /contracts directory
bun run build
  1. Run the local ink-node in the background
# Executed from the /contracts directory
bun run node
  1. (Re-)generate PAPI types
# Executed from the /contracts directory
bun run codegen
  1. Deploy your contract

Put your signers ACCOUNT_URI in .env.<chain> (e.g. .env.pop). By default, the //Alice account is used.

# Executed from the /contracts directory
# If `CHAIN` is not set, it will default to `dev`
CHAIN=pop bun run deploy

Note

The deploy.sh script triggered by bun run deploy will automatically export the deployed contract addresses under /contracts/deployments/<contract>/<chain>.ts. These files are used to be cross-imported in the frontend in frontend/src/lib/inkathon/deployments.ts.


3. Connect the frontend to the local node

Note

Tip: You can also run Next.js and ink-node in parallel via bun run dev-and-node (executed from the project root).

  1. Go to frontend/src/lib/reactive-dot/config.ts and uncomment the dev chain
  2. Go to frontend/src/lib/inkathon/deployments.ts and uncomment the dev address imports & exports
  3. That's it! 🎉

4. Adding a new network

  1. (Re-)generate PAPI types
# Executed from the /contracts directory
bunx papi add -w <websocket-url> <chain-name>
  1. (Re-)deploy your contract
# Executed from the /contracts directory
CHAIN=<chain-name> bun run deploy
  1. Add the new network to the frontend under frontend/src/lib/reactive-dot/config.ts

To-Dos

Important

This is an alpha release. Use it at your own risk.

  • Network Selector
  • Show Balance in UI
  • Account/Address Switcher
  • Indicator & Action to map accounts
  • Faucet Direct Links
  • Dockerfile for self-hosting
  • Claude & Cursor Rules
  • Rust & ink-analyzer VSCode setup
  • New init.sh script for setting up the boilerplate (e.g. update name)
  • More contract examples
  • Chain configuration via environment