visor

package
v0.76.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

README

Vega Visor

A binaries runner for Core and Data Node that facilitates automatic protocol upgrades.

Features:

  • Visor is connected to core nodes and listens for protocol upgrades.
  • Visor allows you to run core and data node binaries based on custom configuration.
  • When a protocol upgrade is ready to be used, Visor automatically stops currently running binaries and starts new ones with the selected version.
  • Visor can be configured to automatically fetch binaries with the correct version during the upgrade.
  • Visor is highly configurable and allows you to configure the number of restarts, restarts delays, specific upgrade configuration and much more.

Architecture

Visor stores all its required config files and state in a home folder. The basic folder structure can be generated by visor init cmd or manually.

Home folder structure:
HOME_FOLDER_PATH
├── config.toml
├── current
├── genesis
│   └── run-config.toml
└── vX.X.X
    └── run-config.toml
  • config.toml - a Visor configuration file.
  • run-config.toml - a Run configuration file.
  • current - a symlink to the currently loaded configuration folder used to run the binaries. On Visor start up, when the current folder is missing, Visor will link to the genesis folder to use as current by default. During the upgrade, if not specified otherwise, Visor will try to link to a folder named after the version of the upgrade - for example vX.X.X. This symlink is automatically managed by Visor and it should not be tampered with manually.
  • genesis - a default folder with Run configuration that Visor automatically links to current folder in case current folder does not exists.
  • vX.X.X - any folder with a name of the upgrade version that stores Run configuration for the upgrade.
Upgrade flow
  1. During the first start up of Visor (when Visor has never been used before) a user provides run-config.toml and stores it in genesis folder.
  2. When Visor starts up, it automatically links the