Main TON monorepo, which includes the code of the node/validator, lite-client, tonlib, FunC compiler, etc.
The Open Network
The Open Network (TON) is a fast, secure, scalable blockchain focused on handling millions of transactions per second (TPS) with the goal of reaching hundreds of millions of blockchain users.
- To learn more about different aspects of TON blockchain and its underlying ecosystem check documentation
- To run node, validator or lite-server check Participate section
- To develop decentralised apps check Tutorials, FunC docs and DApp tutorials
- To work on TON check wallets, explorers, DEXes and utilities
- To interact with TON check APIs
Updates flow
-
master branch - mainnet is running on this stable branch.
Only emergency updates, urgent updates, or updates that do not affect the main codebase (GitHub workflows / docker images / documentation) are committed directly to this branch.
-
testnet branch - testnet is running on this branch. The branch contains a set of new updates. After testing, the testnet branch is merged into the master branch and then a new set of updates is added to testnet branch.
-
backlog - other branches that are candidates to getting into the testnet branch in the next iteration.
Usually, the response to your pull request will indicate which section it falls into.
"Soft" Pull Request rules
- Thou shall not merge your own PRs, at least one person should review the PR and merge it (4-eyes rule)
- Thou shall make sure that workflows are cleanly completed for your PR before considering merge
Build TON blockchain
Ubuntu 22.04, 24.04 (x86-64, aarch64)
Install additional system libraries
sudo apt-get update
sudo apt-get install -y build-essential git cmake ninja-build
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21 clang
Compile TON binaries
cp assembly/native/build-ubuntu-shared.sh .
chmod +x build-ubuntu-shared.sh
./build-ubuntu-shared.sh
MacOS 11, 12 (x86-64, aarch64)
cp assembly/native/build-macos-shared.sh .
chmod +x build-macos-shared.sh
./build-macos-shared.sh
Windows 10, 11, Server (x86-64)
You need to install MS Visual Studio 2022 first.
Go to https://www.visualstudio.com/downloads/ and download MS Visual Studio 2022 Community.
Launch installer and select Desktop development with C++.
After installation, also make sure that cmake is globally available by adding
C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin to the system PATH (adjust the path per your needs).
Open an elevated (Run as Administrator) x86-64 Native Tools Command Prompt for VS 2022, go to the root folder, and execute:
copy assembly\native\build-windows-2022.bat .
build-windows-2022.bat
MSYS2 MinGW64 (x86-64)
Execute from MinGW64 shell
cp assembly/msys2/build-mingw64.sh .
chmod +x build-mingw64.sh
./build-mingw64.sh -a
As a result, you will get fully statically compiled TON windows binaries.
MSYS2 UCRT64 (x86-64)
Execute from ucrt64 shell
cp assembly/msys2/build-ucrt64.sh .
chmod +x build-ucrt64.sh
./build-ucrt64.sh -a
As a result, you will get fully statically compiled TON windows binaries.
Building TON to WebAssembly
Install additional system libraries on Ubuntu
sudo apt-get update
sudo apt-get install -y build-essential git cmake ninja-build
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21 clang
Compile TON binaries with emscripten
cd assembly/wasm
chmod +x fift-func-wasm-build-ubuntu.sh
./fift-func-wasm-build-ubuntu.sh
Building TON tonlib library for Android (arm64-v8a, armeabi-v7a, x86, x86-64)
Install additional system libraries on Ubuntu
sudo apt-get update
sudo apt-get install -y build-essential git cmake ninja-build automake libtool texinfo autoconf libgflags-dev \
libreadline-dev pkg-config libgsl-dev python3 python3-dev libtool autoconf
Compile TON tonlib library
cp assembly/android/build-android-tonlib.sh .
chmod +x build-android-tonlib.sh
./build-android-tonlib.sh
TON portable binaries
Linux portable binaries are wrapped into AppImages, at the same time MacOS portable binaries are statically linked executables. Linux and MacOS binaries are available for both x86-64 and arm64 architectures.
Running tests
Tests are executed by running ctest in the build directory. See doc/Tests.md for more information.