Set up development environment
Summary: In the previous steps, we learned the concept of a smart contract and basic ways of interacting with TON Blockchain through wallets and explorers.
This guide covers the basic steps of setting up your smart contract development environment using Blueprint and creating a basic project template.
Prerequisites
- Basic programming skills.
- Familiarity with the command-line interface.
Set up development environment
For this guide, we will rely on the Blueprint and Node.js/TypeScript stack for writing wrappers, tests, and deployment scripts for your smart contract, as it provides the easiest, ready-to-use environment for smart contract development.
Step 1: install Node.js
Install Node.js for your OS (Windows, macOS, or Linux) using the official installer or a package manager, then verify with the following commands.
Check that npm and node are installed by executing the following commands:
npm -v
node -v
Step 2: choose a smart contract development language
During the guide, we provide examples in FunC, Tolk, and Tact. You can choose any of them and even combine smart contracts in different languages. To proceed through the guide, there is no need for a deep understanding of the chosen language—basic programming skills will be enough.
You can find a brief overview of the languages here: Programming languages.
Step 3: set up Blueprint
Change the directory to the parent folder of your future project and run the following command:
npm create ton@latest
This will run an interactive script to create the project template. You can enter anything you want, but if you want to follow the same names and options as in this guide, choose the following:
- Project name:
Example
- First contract name:
HelloWorld
- Project template: a simple counter contract in Tolk, FunC, or Tact
Finally, change your current directory to the generated project template folder and install all required dependencies:
cd ./Example
npm install
Step 4: set up IDE
TON has plugins that provide syntax support for several IDEs and code editors. You can find them here: plugin list.
Also, consider installing plugins that support JavaScript/TypeScript tools for your preferred IDE or code editor, specifically Jest, for debugging smart contract tests.
Next steps
Blueprint overview