Skip to content

Commit

Permalink
add mytonctrl backups and validator stanby machine docs (#905)
Browse files Browse the repository at this point in the history
Co-authored-by: sonofmom <[email protected]>
  • Loading branch information
yungwine and sonofmom authored Dec 30, 2024
1 parent 80aab0b commit fb86d55
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Node configuration backup and restore
MyTonCtrl allows users to create and restore node configuration backups with two simple, easy-to-use commands. This feature allows node operations to quickly and efficiently transfer node configuration from one host to another.

### Manually create backup package
# Manual backup creation is initialized with the `create_backup` command, the backup creation process should not take more than a few seconds.

MyTonCtrl will create a backup package in the home directory of the MyTonCtrl user, the package name will include the hostname as well as the epoch timestamp of the backup.

The backup will contain
* Node configuration file (`/var/ton-work/db/config.json`)
* Node keyring (`/var/ton-work/db/keyring`)
* Node liteserver and console keys (`/var/ton-work/keys`)
* MyTonCtrl configuration database and files (`~/.local/share/mytoncore`)
* Wallet and pool information

### Automated backup creation
If your node is participating in validation, you can set up automated backups of the node configuration; this backup will be performed immediately after your node participates in the elections, thus ensuring that all data required for the upcoming validation cycle has been preserved.
To enable automated backups, please set the parameter: `auto_backup` to `true` by issuing command `set auto_backup true` on MyTonCtrl console.

#### Automated backups location and lifecycle
By default, automated backups are stored in directory `/tmp/mytoncore/auto_backups/` within home of the user mytoncore process is running under. You can adjust this by setting parameter `auto_backup_path` in MyTonCtrl console.

Automated backups older than 7 days will be deleted.

### Restore backup package
**Important Notes**:
1) Please ensure that you have stopped / disabled the Ton node on the donor machine. Failure to do so will result in connectivity and synchronization problems on both machines. We also recommend that you stop the donor node 20 minutes before applying the backup data to the new machine.
2) Before restoring the backup package to the existing node, we strongly recommend that you manually backup the original configuration of the node to ensure a possible rollback path.

Use the `restore_backup <file_name>` command and follow the instructions.
Backups should be restored to a fully synchronized node, MyTonCtrl will keep all settings except the IP address which will be adjusted accordingly.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Standby validator nodes
Ensuring the uninterrupted and reliable operation of validators is of paramount importance to validator node operators. Failure to do so can affect the performance of the TON network and can result in significant penalties.

However, no system is perfect or reliable, and validators may fail to perform their duties for reasons such as

* Loss of TON network synchronization due to hardware overload or physical network problems
* Hardware failure
* ISP failure

## Standby node
We recommend that all validator operators maintain at least one standby node that can take over validation duties if the main machine fails.

The standby machine should ideally be hosted at a different physical location / ISP. Such machine should have MyTonCtrl installed in full node mode, and should be synchronized with the TON blockchain network. Hardware sizing should match your main validator configuration.

## Standby activation mechanics
At present, the standby node is activated manually by the node operator. There is no automated main/standby operation.

## Backup
In order to transfer validation duties from the main node to the standby node, operators need the following data

* up-to-date MyTonCtrl configuration database and files
* up-to-date node configuration file and keyring
* keys required for MyTonCtrl functionality

MyTonCtrl provides functionality to [create backups](mytonctrl-backup-restore) that contain all required data. If you are running a validator node, we strongly recommend that you set up [automated backups](mytonctrl-backup-restore#automated-backup-creation) and download backup archives from your machine frequently.

## Restore
Before transferring the validator configuration to the standby machine, please ensure that you have stopped / disabled the TON node on the donor machine for ~20 minutes. Failure to do so will result in connectivity issues and crashes on both the donor and target machines.

The restore process is [described in Backups](mytonctrl-backup-restore)

Please ensure that you create and retain the backup of your standby node original configuration before you apply/restore a backup package from another machine, as you will need this to bring the standby node back into standby mode.

## Standby rollback
If you wish to transfer your validator configuration back to the main validator machine and restore the standby node, please do the following

1) Back up the active validator configuration on the standby node.
2) Transfer the configuration to the main Validator machine following the instructions above
3) Restore the backup of your standby node's original configuration that you created before the validator configuration was applied to it.

2 changes: 2 additions & 0 deletions sidebars/documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ module.exports = [
'v3/documentation/infra/nodes/mytonctrl/mytonctrl-alerting',
'v3/documentation/infra/nodes/mytonctrl/mytonctrl-status',
'v3/documentation/infra/nodes/mytonctrl/mytonctrl-errors',
'v3/documentation/infra/nodes/mytonctrl/mytonctrl-backup-restore',
'v3/documentation/infra/nodes/mytonctrl/mytonctrl-validator-standby',
],
},
'v3/documentation/infra/nodes/node-commands',
Expand Down

0 comments on commit fb86d55

Please sign in to comment.