Documentation Index
Fetch the complete documentation index at: https://companyname-a7d5b98e-run-archive-liteserver.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
An archive liteserver node is a type of full node that stores the entire block history of the TON blockchain. If you are building a blockchain explorer, an indexer, or any application requiring access to historical data, running an archive liteserver node is the recommended approach. This guide explains how to set up an archive liteserver using MyTonCtrl and ZFS for efficient storage management.Step 1: Prepare environment
1.1 Minimal hardware requirements
Running an archive liteserver requires significant storage and network resources.- 16-core CPU
- 128 GB RAM
- At least 16TB of SSD storage, 20TB if you will not use ZFS with compression (NVMe recommended), or Provisioned 64k+ IOPS storage
- 1 Gbit/s symmetric connectivity (both inbound and outbound), ~16 TB/month at peak load
- Fixed (static) public IP address
1.2 OS and system requirements
- Ubuntu 22.04 LTS, Ubuntu 24.04 LTS, or Debian 11
- Python 3.10 or higher
- Open Files Limit must be set above 4,000,000
1.3 Subscribe to official channels
Subscribe and follow the announcements provided for liteservers in the following Telegram channels:| Channel | Network |
|---|---|
| @tonstatus | TON Mainnet |
| @testnetstatus | TON Testnet |
1.4 Install ZFS and prepare volume
Archive nodes benefit significantly from ZFS due to its native compression and snapshot capabilities.1.4.1 Install ZFS
1.4.2 Verify physical block size
For NVMe drives, it is critical to align the ZFS pool’s sector size with the drive’s physical block size to avoid significant performance degradation. Most modern NVMe drives use 4K blocks. Verify your drive’s physical block size:4096, you must use the -o ashift=12 parameter during pool creation.
1.4.3 Create a storage pool
Create a ZFS pool nameddata. Use -o ashift=12 for 4K blocks (standard for most NVMe drives):
1.4.4 Enable compression
We recommend enablinglz4 compression to save disk space with minimal CPU overhead:
1.4.5 Create dataset and mountpoint
Create the dataset for TON data and set the mount point to/var/ton-work:
1.5 Prepare the operator account
If you need a dedicated operator user, create it and switch to it before installing MyTonCtrl:- Create a non-root user
- Switch to it by reconnecting to the server via
ssh
1.6 Harden server security
SSH hardening
Apply the following SSH configuration changes in/etc/ssh/sshd_config:
- Enable key-based authentication and disable password login:
- Disable root login:
- Change the default SSH port:
<SSH_PORT> — a non-default port number (for example, 2222).
- Restrict SSH access to specific IP addresses using the
Match Addressdirective:
Firewall configuration
Enable the firewall and allow only the SSH port. The node UDP port and liteserver port are added after installation in step 2.1.3.Additional security measures
- Use a unique, strong password for the root user.
- Set a GRUB bootloader password to prevent unauthorized boot modifications.
-
Enable Fail2ban for SSH brute-force protection:
-
Configure two-factor authentication for SSH using
libpam-google-authenticatoror a similar PAM module.
Step 2: Archive liteserver installation
The installation process consists of three lengthy stages (in total, this can take up to a week):- Downloading historical blocks from TON Storage and installing the archive liteserver
- Importing downloaded data into the archive liteserver database
- Final synchronization of the archive liteserver
2.1 Downloading historical blocks from TON Storage and installing the archive liteserver
This process can take from one to several days depending on your internet connection speed.2.1.1 Install prerequisites and download installer (MyTonCtrl)
2.1.2 Run archive liteserver installation
Run the installer from the operator account withsudo so it can create system users and services:
2.1.3 Open the node UDP port and the liteserver port
At this stage, the node UDP port and liteserver port should be opened to make the archive liteserver available for syncing blocks from other nodes. Identify theengine.addr port and liteserver port from the config.json file:
ufw on bare-metal hosts:
2.2 Importing downloaded data into the archive liteserver database
This process starts automatically after installation and can take from one to several days depending on your server performance. You can monitor the progress using the MyTonCtrl console:2.3 Final synchronization of archive liteserver
This process starts automatically after the importing process finishes and can take from one to several days depending on your server performance. You can monitor the progress using the MyTonCtrl console:Step 3: Maintenance
3.1 Set up alerting
Set up alerting in MyTonCtrl to get a notification of critical issues with the archive liteserver. For more information, see MyTonCtrl private alerting bot.3.2 Set up monitoring
Set up monitoring dashboards for RAM, disk, network, CPU usage, and other metrics. For system-level metrics, integrate Prometheus withnode_exporter with MyTonCtrl.
It is critical to use the monitoring system to:
- monitor server stability
- monitor synchronization parameters
- check for memory leaks
3.3 Performing software updates
Follow the @tonstatus channel, turn on notifications, and be prepared for urgent updates if needed. Before performing any updates, it is highly recommended to create a ZFS snapshot of your data. This allows you to quickly roll back in case the update process fails or corrupts the database.3.4 ZFS Snapshots
ZFS allows you to create snapshots for easy rollbacks if data corruption occurs.Create a snapshot
Snapshots can be created without stopping the node:List snapshots
To see all existing snapshots for thedata/ton-work dataset:
Roll back to a snapshot
To restore data from a snapshot, you must stop the validator service first:Delete a snapshot
Once a snapshot is no longer needed, you can delete it:3.5 Archiving ZFS snapshots
Creating a snapshot is instantaneous and happens on the same physical disks where your data is stored. To protect against hardware failure, you should export your snapshots to external storage or a remote server usingzfs send.
Exporting a snapshot to a file
Before exporting, estimate the size of the snapshot:-c flag to preserve lz4 compression (without it, the file will be significantly larger):
Transferring a snapshot via SSH
You can stream a snapshot directly to a remote ZFS-enabled server:Troubleshooting
Monitoring import logs
To see detailed logs of the block import process, increase the log verbosity from the MyTonCtrl console:1 after checking logs to avoid excessive disk I/O overhead:
Performance issues
If you see logs likeImporting archive for masterchain seqno #... from net accompanied by timeout errors, it likely indicates that your storage performance is insufficient to keep up with the block import process. Ensure your disk meets the IOPS requirements listed in section 1.1.