Skip to main content
Canvas is a Node/TypeScript service: a grammY Telegram bot behind an Express server, Postgres for state, viem for Base, and Kimi for scoring. This guide gets it running locally.

Prerequisites

  • Node 21+ (the project targets >=21 <24)
  • PostgreSQL — any local instance; the schema self-applies on boot
  • A test Telegram bot token from @BotFather
  • A public HTTPS URL for the webhook (e.g. an ngrok tunnel) — the bot runs webhook-only
  • Foundry (optional) — only to run the contract tests
Never boot with the production bot token locally — the app registers its own webhook on startup and would steal the production webhook. Always use a separate test bot.

Steps

1

Clone and install

2

Configure environment

Fill in the four required variables (the app fails to boot without them):Everything else has a default or is optional — see Environment variables.
3

Run

The server binds /health, applies the Postgres schema, and registers the Telegram webhook on boot.

Useful scripts

Contracts

The escrow contract is contracts/CanvasEscrowV0.sol (see Smart contract).

Next