|
| 1 | +# MyTonCtrl Remote Controller |
| 2 | + |
| 3 | +MyTonCtrl and TON Node can be used on separate machines. There are some advantages of using that: |
| 4 | + |
| 5 | +* To participate in elections, the validator wallet's private key is required by MyTonCtrl. If the Node server |
| 6 | +is compromised, it could lead to unauthorized access to the wallet funds. As a security measure, MyTonCtrl can be hosted on a separate server. |
| 7 | +* MyTonCtrl continually expands its functionality, which may consume resources crucial for the Node. |
| 8 | +* Probably in future big validators will be able to host several instances of MyTonCtrl controlling several nodes on one server. |
| 9 | + |
| 10 | +## Setting up |
| 11 | + |
| 12 | +Prepare 2 servers: one is for running TON Node that meets the requirements and one is for running MyTonCtrl which does not require a lot of resources. |
| 13 | + |
| 14 | +1. Node server: |
| 15 | + |
| 16 | +Install MyTonCtrl in `only-node` mode: |
| 17 | + |
| 18 | +``` |
| 19 | +wget https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/scripts/install.sh |
| 20 | +sudo bash install.sh -m validator -l |
| 21 | +``` |
| 22 | + |
| 23 | +It will install TON Node and create a backup file which you need to download and transfer to the Controller server: |
| 24 | + |
| 25 | +```log |
| 26 | +... |
| 27 | +[debug] 01.01.2025, 00:00:00.000 (UTC) <MainThread> start CreateSymlinks fuction |
| 28 | +Local DB path: /home/user/.local/share/mytoncore/mytoncore.db |
| 29 | +[info] 01.01.2025, 00:00:00.000 (UTC) <MainThread> start ConfigureOnlyNode function |
| 30 | +[1/2] Copied files to /tmp/mytoncore/backupv2 |
| 31 | +[2/2] Backup successfully created in mytonctrl_backup_hostname_timestamp.tar.gz! |
| 32 | +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. |
| 33 | +[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. |
| 34 | +[debug] 01.01.2025, 00:00:00.000 (UTC) <MainThread> Start/restart mytoncore service |
| 35 | +[debug] 01.01.2025, 00:00:00.000 (UTC) <MainThread> sleep 1 sec |
| 36 | +[5/5] Mytonctrl installation completed |
| 37 | +``` |
| 38 | + |
| 39 | +Note, that you still got access to MyTonCtrl console on this server, which you need to update the Node, watch Node metrics, etc. |
| 40 | +Also, it creates a `mytoncore` service which is used to send telemetry (if it was not disabled). |
| 41 | +If you want to return control of the node to this server, use command |
| 42 | + |
| 43 | +```bash |
| 44 | +MyTonCtrl> set onlyNode false |
| 45 | +systemctl restart mytoncore |
| 46 | +``` |
| 47 | + |
| 48 | +2. Controller server |
| 49 | + |
| 50 | +Install MyTonCtrl in `only-mtc` mode: |
| 51 | + |
| 52 | +``` |
| 53 | +wget https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/scripts/install.sh |
| 54 | +sudo bash install.sh -p /home/user/mytonctrl_backup_hostname_timestamp.tar.gz -o |
| 55 | +``` |
| 56 | + |
| 57 | +Check the `status` command, there should appear `Node IP address` field: |
| 58 | + |
| 59 | +```log |
| 60 | +MyTonCtrl> status |
| 61 | +[debug] 01.01.2025, 00:00:00.000 (UTC) <MainThread> start GetValidatorWallet function |
| 62 | +[debug] 01.01.2025, 00:00:00.000 (UTC) <MainThread> start GetLocalWallet function |
| 63 | +[debug] 01.01.2025, 00:00:00.000 (UTC) <MainThread> start GetWalletFromFile function |
| 64 | +[debug] 01.01.2025, 00:00:00.000 (UTC) <MainThread> start WalletVersion2Wallet function |
| 65 | +[debug] 01.01.2025, 00:00:00.000 (UTC) <MainThread> start GetDbSize function |
| 66 | +===[ Node status ]=== |
| 67 | +Node IP address: 0.0.0.0 |
| 68 | +Validator index: n/a |
| 69 | +... |
| 70 | +``` |
| 71 | + |
| 72 | +## Notes |
| 73 | + |
| 74 | +On updates, you need to `update` and `upgrade` both Node server and Controller server |
0 commit comments