Skip to main content

Setting up the environment

To start working with Tolk, you’ll need a development environment.

We recommend using Blueprint, a tool for writing, testing, and deploying smart contracts on TON.

Create a new TON project

(Node.js version 16 or higher required)

  1. Create a new TON project:

    npm create ton@latest
  2. Enter any project name and select "A simple counter contract (Tolk)" when prompted by Blueprint.

Project structure:

my-first-contract/
├── build/ # Compiled smart contract bytecode
├── contracts/ # Smart contract sources (e.g., counter.tolk)
├── scripts/ # TypeScript deployment scripts
├── tests/ # TypeScript tests
├── wrappers/ # TypeScript wrappers for contracts

Build

npx blueprint build or yarn blueprint build

The result (smart contract(s) bytecode and its hash) will be displayed in the console and saved in build/ directory.

Test

npx blueprint test or yarn blueprint test

Run unit tests from the test/ folder.

Deploy or run script

npx blueprint run or yarn blueprint run

This way, you can deploy your smart contract to the mainnet, testnet, or MyLocalTon.

IDE Support

Tolk is supported by the IntelliJ IDEs and VS Code with "TON" extension.

Was this article useful?