Using toncli
toncli—The Open Network cross-platform smart contract command line interface.
Easy to deploy and interact with TON smart contracts.
Good solution for Python stack developers.
Quick Start 📌
Here are tutorials made using a toncli library:
- Quick start guide—simple steps for deploying an example smart contract to TON.
- TON Learn: FunC journey overview. Part 1
- TON Learn: FunC journey overview. Part 2
- TON Learn: FunC journey overview. Part 3
- TON Learn: 10 zero-to-hero lessons (Ru version)
Installation 💾
Docker: linux / macOS (m1 supported)
Linux / macOS (intel)
1) Download the necessary special pre-builds (use the latest build)
To download the necessary files, you must log-in to your account
2) Install Python3.9 or higher
3) Run in terminal pip install toncli
or pip3 install toncli
If you see WARNING: The script toncli is installed in '/Python/3.9/bin' which is not on PATH
, then add the full path to bin to the PATH env
4) Run toncli
and pass absolute path to func/fift/lite-client
from first step
Windows
1) Download the necessary special pre-builds from here (use the latest build)
To download the necessary files, you must log-in to your account
2) Install Python3.9 or higher
During installation, on the first screen, you need to click the Add Python to PATH
checkbox
3) Open the terminal as an administrator and pip install toncli
by installing toncli
4) Unzip the downloaded archive and add libcrypto-1_1-x64.dll to unziped files
5) Open the folder in the console for windows users:
Windows 11:
- Right mouse button, open in the terminal
Windows 10:
- Copy the path in Explorer and run in Terminal
cd FULL PATH
Create a project ✏️
These are simple steps to deploy an example smart contract in TON. You can read the official documentation here
Step-by-step guide
1) Open the terminal as an administrator and go to your project folder
2) To create a project, run toncli start YOUR-PROJECT-NAME
3) Go to the project folder cd YOUR-PROJECT-NAME
Toncli has created a simple wallet project, you can see 4 folders in it:
- build
- func
- fift
- test
4) You can deploy it to testnet or mainnet: toncli deploy -n testnet
Examples
Contributors have prepared sample projects very well covered by the new tests. For example, now two commands can be used to deploy an NFT collection or a Jetton.
toncli start nft_colletion/jetton_minter/nft_item/jetton_wallet
All of these projects have a lot of interesting examples of toncli and blockchain interaction, as well as extremely tests that will help in developing custom smart contracts.
To test smart contracts using toncli, go to testing
Useful articles
Other useful articles about using toncli in development: