跳到主要内容

MyTonCtrl remote controller

MyTonCtrl and TON node can be used on separate machines. There are several advantages to this setup:

  • To participate in elections, the validator wallet's private key is required by MyTonCtrl. If the node server is compromised, it could lead to unauthorized access to the wallet funds. As a security measure, MyTonCtrl can be hosted on a separate server.
  • MyTonCtrl continually expands its functionality, which may consume resources crucial for the node.

Setting up

Prepare two servers: one for running the TON node (meeting the OS requirements and hardware requirements) and one for running MyTonCtrl, which does not require many resources.

  1. node server:

Install MyTonCtrl in only-node mode:

wget https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/scripts/install.sh
sudo bash install.sh -m validator -l
  • -m validator — installs in validator mode.
  • -l — only-node mode: installs TON node only, no MyTonCtrl controller.

It will install the TON node and create a backup file which you need to download and transfer to the controller server. The backup archive is saved under /tmp/mytoncore/backupv2/ with a name like mytonctrl_backup_hostname_timestamp.tar.gz.

...
[debug] 01.01.2025, 00:00:00.000 (UTC) <MainThread> start CreateSymlinks function
Local DB path: /home/user/.local/share/mytoncore/mytoncore.db
[info] 01.01.2025, 00:00:00.000 (UTC) <MainThread> start ConfigureOnlyNode function
[1/2] Copied files to /tmp/mytoncore/backupv2
[2/2] Backup successfully created in mytonctrl_backup_hostname_timestamp.tar.gz!
If you wish to use archive package to migrate node to different machine please make sure to stop validator and mytoncore on donor (this) host prior to migration.
[info] 01.01.2025, 00:00:00.000 (UTC) <MainThread> Backup successfully created. Use this file on the controller server with `--only-mtc` flag on installation.
[debug] 01.01.2025, 00:00:00.000 (UTC) <MainThread> Start/restart mytoncore service
[debug] 01.01.2025, 00:00:00.000 (UTC) <MainThread> sleep 1 sec
[5/5] MytonCtrl installation completed

Note that you still have access to the MyTonCtrl console on this server, which you can use to update the node and monitor node metrics, etc. Also, it creates a mytoncore service which is used to send telemetry (if it was not disabled). If you want to return control of the node to this server, use the following commands:

MyTonCtrl> set onlyNode false
systemctl restart mytoncore
  1. Controller server:

Install MyTonCtrl in only-mtc mode:

wget https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/scripts/install.sh
sudo bash install.sh -p /home/user/mytonctrl_backup_hostname_timestamp.tar.gz -o
  • -p <path> — specifies the path to the backup archive.
  • -o — only-mtc mode: installs MyTonCtrl only, no TON node.

Run the status command; you should see the node’s IP address when configured:

MyTonCtrl> status
[debug] 01.01.2025, 00:00:00.000 (UTC) <MainThread> start GetValidatorWallet function
[debug] 01.01.2025, 00:00:00.000 (UTC) <MainThread> start GetLocalWallet function
[debug] 01.01.2025, 00:00:00.000 (UTC) <MainThread> start GetWalletFromFile function
[debug] 01.01.2025, 00:00:00.000 (UTC) <MainThread> start WalletVersion2Wallet function
[debug] 01.01.2025, 00:00:00.000 (UTC) <MainThread> start GetDbSize function
===[ Node status ]===
Node IP address: <configured_ip>
Validator index: n/a
...

Notes

On updates, you need to update and upgrade both the node server and the controller server

Was this article useful?