This guide describes how to set up an archive liteserver using MyTonCtrl, with ZFS for storage compression and snapshots. An archive liteserver node stores the entire block history of the TON blockchain. For applications requiring access to historical data, such as blockchain explorers or indexers, running an archive liteserver node is the recommended approach.Documentation Index
Fetch the complete documentation index at: https://companyname-a7d5b98e-run-liteserver.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- A server meeting the minimal hardware requirements
- An OS meeting the software requirements
Step 1: Prepare environment
1.1 Minimal hardware requirements
Running an archive liteserver requires large storage and network capacity:- 16-core CPU
- 128 GB RAM
- NVMe Gen4+ SSD storage (Enterprise grade preferred), sustaining at least 64,000 provisioned IOPS:
- at least 16 TB with ZFS
lz4compression enabled, or - at least 20 TB without compression
- at least 16 TB with ZFS
- 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/24.04 LTS or Debian 11/12
- 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 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, ZFS pool sector size must align with the drive’s physical block size to avoid performance degradation. Most modern NVMe drives use 4K blocks. Verify the physical block size:4096, the -o ashift=12 parameter must be used 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):
<DISK>is the target disk device identifier, e.g.,/dev/nvme1n1;<DISK1>,<DISK2>, and<DISK3>are additional disk device identifiers.
1.4.4 Enable compression
Enablelz4 compression to save disk space with minimal CPU overhead:
1.4.5 Create dataset and mount point
Create the dataset for TON data and set the mount point to/var/ton-work:
1.5 Prepare the operator account
To create a dedicated operator user and switch to it before installing MyTonCtrl:-
Create a non-root user:
-
Switch to the new operator account by reconnecting via SSH:
1.6 Benchmark server performance
Before installing, verify that the server meets performance requirements. Inadequate disk or network performance is the most common cause of node instability.1.6.1 Network latency
Check latency to TON beacon nodes. Expect approximately 50 milliseconds to the nearest beacon and up to 300 milliseconds to the farthest:1.6.2 Disk IOPS
Installfio and run a random read/write benchmark:
--refill_buffers and --buffer_compress_percentage=0 flags force incompressible data. Without them, LZ4 on the data/ton-work dataset collapses fio’s zero-filled writes and reports IOPS far above what the archive import sustains.
Minimum acceptable results:
| Metric | Minimum |
|---|---|
| Read | 10,000 IOPS |
| Write | 10,000 IOPS |
1.6.3 Network bandwidth
Verify network throughput withspeedtest-cli:
1.7 Harden server security
Apply security hardening steps before exposing the server to the network: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, e.g., to
2222: -
Restrict SSH access to specific permitted IP addresses using the
Match Addressdirective:There,<USERNAME>is the name of the operator user.
Firewall configuration
Enable the firewall and allow only the SSH port. The node UDP port and liteserver port are added after installation in open the node UDP port and the liteserver port.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 stages (in total, this can take up to a week):- Download historical blocks from TON Storage and install the archive liteserver
- Import downloaded data into the archive liteserver database
- Final synchronization of the archive liteserver
2.1 Download historical blocks from TON Storage and install the archive liteserver
This process can take from one to several days depending on the internet connection speed.2.1.1 Install prerequisites and download MyTonCtrl installer
2.1.2 Run archive liteserver installation
Run the installer from the operator account withsudo so it can create system users and services:
2.2 Import downloaded data into the archive liteserver database
This process starts automatically after installation and can take from one to several days depending on server performance. Monitor the progress from the MyTonCtrl console. Open the console:MyTonCtrl> prompt, run:
Local validator initial sync status field. The value indicates how old the last imported block was and should decrease over time.
2.2.1 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 the node UDP port and liteserver port from theconfig.json file:
ufw on bare-metal hosts:
<NODE_UDP_PORT>is the UDP port of the validator engine;<LITESERVER_PORT>is the TCP port of the liteserver.
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 server performance. Monitor the progress from the MyTonCtrl console. Open the console:MyTonCtrl> prompt, run:
Local validator initial sync status field reports how old the last imported block was, decreasing over time. Once initial sync completes, that line disappears and freshness is reported by the Local validator out of sync field. On a fully synchronized node, out-of-sync time stays below 20 seconds.
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. It is critical to use the monitoring system to:- monitor server stability;
- monitor synchronization parameters;
- check for memory leaks.
node_exporter with MyTonCtrl.
For technical assistance, contact @mytonctrl_help_bot.
3.3 Perform software updates
Before performing updates, create a ZFS snapshot of the data. This allows a quick rollback if the update process fails or corrupts the database.MyTonCtrl> prompt, update MyTonCtrl to the tip of the master branch:
update finishes. Reopen it with mytonctrl and upgrade the TON node binaries to the tip of the master branch:
3.4 ZFS snapshots
ZFS creates snapshots for easy rollbacks if data corruption occurs.Create a snapshot
Snapshots can be created under a unique identifier without stopping the node :List snapshots
To see all existing snapshots for thedata/ton-work dataset:
Roll back to a snapshot
Delete a snapshot
Delete the snapshot when it is no longer needed:3.5 Archive ZFS snapshots
Creating a snapshot is instantaneous and occurs on the same physical disks where the data is stored. To protect against hardware failure, export the snapshots to external storage or a remote server usingzfs send.
Export a snapshot to a file
Before exporting, estimate the size of the snapshot:-c flag to preserve LZ4 compression. Without it, the file expands to the uncompressed size of the dataset:
/mnt/backup/backup_ton_work.zfs
Transfer a snapshot via SSH
Stream a snapshot directly to a remote ZFS-enabled server:<REMOTE_USER>is the username on the remote host;<REMOTE_HOST>is an IP address or hostname of the remote host;<REMOTE_POOL>is the name of the remote ZFS pool.
Troubleshooting
Monitor import logs
To see detailed logs of the block import process, increase the log verbosity from the MyTonCtrl console. Open the console:MyTonCtrl> prompt, run:
1 after checking logs to avoid excessive disk I/O overhead. At the MyTonCtrl> prompt, run:
Performance issues
Logs containing “Importing archive for masterchain seqno #… from net” accompanied by timeout errors indicate insufficient storage performance. Ensure the disk meets the IOPS requirements listed in Minimal hardware requirements. To verify disk and system performance, run the built-inmytonctrl benchmark:
-
Stop the validator service, since the benchmark refuses to run while it is active:
-
Open the MyTonCtrl console:
At the
MyTonCtrl>prompt, run:The benchmark spins up a local test network and requiresuv. Ifuvis not installed, the console prompts to install it. For stable liteserver operation, the reportedAvg TPSandAvg blocks/sshould each reach at least 70% of their expected values. -
Restart the validator service once the benchmark finishes:
Support
For technical assistance, join the official support channel:@ton_node_help.