How to Build and Run the TON Node

Aug 24, 2024 | Blockchain

The Open Network (TON) is a groundbreaking blockchain system designed to handle millions of transactions per second (TPS). If you’re eager to dive into the world of TON and set up your very own node, validator, or lite-server, this guide is for you! We’ll walk you through the installation steps and troubleshoot common issues along the way.

Prerequisites

Before we begin, ensure that you have the following installed on your system:

  • Git
  • Build essentials
  • Appropriate compilers (CMake, Ninja, etc.)

Step-by-Step Installation

Let’s break down the installation process by operating system:

For Ubuntu (20.04, 22.04)

Follow these commands to install necessary libraries and compile the TON binaries:

sudo apt-get update
sudo apt-get install -y build-essential git cmake ninja-build zlib1g-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 16 all
cp assembly/native/build-ubuntu-shared.sh .
chmod +x build-ubuntu-shared.sh
./build-ubuntu-shared.sh

For MacOS (11, 12)

Use the following commands to set up on MacOS:

cp assembly/native/build-macos-shared.sh .
chmod +x build-macos-shared.sh
./build-macos-shared.sh

For Windows (10, 11, Server)

First, ensure that MS Visual Studio 2022 is installed. Then execute the following:

copy assembly/native/build-windows.bat .
build-windows.bat

Building for WebAssembly

If you want to compile for WebAssembly, execute:

sudo apt-get update
sudo apt-get install -y build-essential git cmake ninja-build zlib1g-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev
cd assembly/wasm
chmod +x fift-func-wasm-build-ubuntu.sh
./fift-func-wasm-build-ubuntu.sh

Testing Your Build

Once the build is complete, you can run tests to ensure everything is functioning correctly:

cd 
ctest

Understanding the Build Process: An Analogy

Think of building the TON blockchain as constructing a large, intricate Lego model. Just like a Lego set, you need specific building blocks (or dependencies) to complete the model. Each step in our installation guide represents a different task in the construction process, ensuring that each piece is in its correct place. If you forget to add a necessary brick at the start, you might find it easy to get stuck in the middle, unable to assemble the whole structure!

Troubleshooting

If you encounter issues, here are some troubleshooting ideas:

  • Ensure all system libraries are installed as specified for your OS.
  • Check your internet connection, especially when downloading any scripts or dependencies.
  • If you face any build-related errors, review the logs carefully to identify which step may have failed.
  • Consult the TON documentation for frequently asked questions and further help.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Final Thoughts

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox