Comprehensive Guide to Setting Up and Running an Archive Node on TON Blockchain

Introduction

Archive Nodes play a pivotal role in blockchain ecosystems, particularly for applications that necessitate access to comprehensive historical data. This guide provides a detailed walkthrough on setting up and operating an Archive Node on the TON Blockchain, designed for developers and operators of blockchain explorers or services requiring extensive historical records.

System Requirements and Prerequisites

Before initiating the setup process, ensure your system meets the following requirements:

  • Operating System: Ubuntu 20.04, Ubuntu 22.04, or Debian 11.

  • User Privileges: A non-root user with sudo privileges.

  • Hardware Specifications:

    Component Specification
    CPU 16 Cores
    Memory 128GB ECC
    Storage 4TB SSD or Provisioned 32+k IOPS
    Network 1 Gbit/s Connectivity
    Traffic 16 TB/month on peak
    Additional Fixed Public IP Address

Note: The 4TB storage recommendation assumes the use of a ZFS volume with compression enabled.

Installation Steps

1. Install ZFS and Prepare the Volume

The Archive Node data is provided in the form of ZFS Snapshots, requiring ZFS on your host system. Install ZFS and create a dedicated pool on a 4TB disk named data. Enabling compression on the ZFS filesystem (lz4) is recommended to optimize storage usage.

Commands:

sudo apt install zfsutils-linux
sudo zpool create data <disk>
sudo zfs set compression=lz4 data

2. Install MyTonCtrl

Follow the instructions provided in the Running Full Node guide to install MyTonCtrl on your system.

3. Download and Restore the Dump Data

Obtain access credentials from the @TONBaseChatEn Telegram chat, then use the following command to download and restore the dump data from https://archival-dump.ton.org:

wget --user <usr> --password <pwd> -c https://archival-dump.ton.org/dumps/latest.zfs.lz | pv | plzip -d -n <cores> | zfs recv data/ton-work

Replace <usr> and <pwd> with your credentials, and adjust <cores> to match your CPU’s capabilities for optimal extraction speed.

4. Configure and Start the Archive Node

After restoring the dump, ensure correct permissions are set for the /var/ton-work directory. Update the node configuration to specify storage settings for the Archive Node. Start the node with the following command:

systemctl start validator.service

Monitor the node’s synchronization process using MyTonCtrl’s status command.

Node Maintenance

Regular maintenance is crucial for optimal Archive Node performance. This includes stopping the validator service, cleaning old logs, removing temporary files, and restarting the service. Commands for each step are detailed in the main guide.

Troubleshooting and Backups

In case of operational issues, you may roll back to a previous state using ZFS snapshots. Regularly snapshotting your filesystem is recommended for easy rollback and data integrity.

Support and Community

For additional support and questions, join the TON dev chat on Telegram.

Conclusion

Running an Archive Node on the TON Blockchain is a straightforward process with the right preparation and resources. This guide provides the necessary steps and best practices to ensure your node is set up correctly and maintained for optimal performance.

This guide aims to empower developers and operators with the knowledge and tools required to successfully deploy and manage an Archive Node on the TON Blockchain, ensuring access to valuable historical data for a wide range of applications.

1 Like