跳到主要内容

Setup development environment

Summary: In previous steps we learned concept of smart contract and basic ways of interacting with TON Blockchain through wallet apps and explorers.

This guide covers basic steps of setting up your smart contract development environment using Blueprint SDK and creating basic project template.

Prerequisites

  • Basic programming skills.
  • Familiarity with Command-line interface.

Setup development environment

For this guide we will rely on Blueprint SDK and Node.js/TypeScript stack for writing wrappers, tests and deployments scripts for your smart contract, because its provides easiest, ready to use environment for smart contracts developing.

信息

Using native instruments and language-dependent SDK's for smart contract development covered in more advanced sections here:

Step 1: Install Node.js

First, visit installation page and execute download commands in PowerShell or Bash corresponding to your operating system Windows/Linux.

Check that npm and node installed by executing following command:

npm -v
node -v

Step 2: Choose smart contract development language

During guide we provide example on: Func, Tolk and Tact. You can choose from any of them and even combine smart contracts on different languages. To proceed through guide there is now need of deep understanding of choosed one, basic programming skills will be enought.

信息

You can find breaf overview of languages here: Programming languages

Step 3: Setup Blueprint SDK

Change directory to parent folder of your future project and run following command:

npm create ton@latest

This will run interactive script for creating project template, you can enter anything you want, but if you want to have same paths as this guide choose following:

  1. Project name: Example.
  2. First created contract name: HelloWorld.
  3. Choose the project template: A simple counter contract on FunC or Tolk.

And finally, change your current directory to generated project template folder, and install all required dependencies:

cd ./Example
npm install

Step 4(optional): IDE and editors support

Ton community developed plugins providing syntax support for several IDE's and code editors. You can find them here: Plugin List.

Also consider installing plugins providing support for JavaScript/TypeScript tools for your preferred IDE or code editor and, specifically, Jest for debugging smart contract tests.