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.
But before we proceed to actual coding let's install and setup all required tools!
- Basic programming skills.
- Familiarity with Command-line interface.
- Your preferred code-editor/IDE.
- Around 15 minutes of your time.
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.
:::info Using native instruments and language-dependent SDK's for smart-contract development covered in more advanced sections here:
First, visit installation page and execute download commands in PowerShell or Bash corresponding to your operating system Windows/Linux.
Check node version by executing following command:
node -v
npm -v
Node version should be at least v18
.
During guide we provide example on 3 languages: Func
, Tact
and Tolk
. You can choose from any of them and even combine smart-contracts on different languages on latest sections. To proceed through guide there is now need of deep understanding of choosed one, basic programming skills will be enought. You can find their breaf overview here: Programming languages
Change directory to parent folder of your future project and run following command:
npm create ton@latest
TODO: add short language description for choosing prefered one.
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:
- Project name:
Example
. - First created contract name:
HelloWorld
. - Choose the project template: A simple counter contract corresponding to your choosen language.
And finally, change your current directory to generated project template folder, and install all required dependencies:
cd ./Example
npm install
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.