Skip to content

Commit

Permalink
Remove algorand package in host-based setups
Browse files Browse the repository at this point in the history
  • Loading branch information
hsoerensen committed Feb 6, 2024
1 parent e2088f2 commit d050b7c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
9 changes: 5 additions & 4 deletions bin/migrate-from-d13-setup → bin/migrate-from-host-setup
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ if [[ $(id -u) -eq 0 ]]; then
is_root=1
fi

echo "This script will assist migrating your node from D13 based setups to Voi Swarm, if your node is already running D13 based setup."
echo "If you are running a D13 based setup on another service follow guidance in the documentation to migrate to Voi Swarm: https://voinetwork.github.io/voi-swarm/"
echo "This script will assist migrating your node from a host-based setups to Voi Swarm, if your node is already running a Voi or Algorand based setup."
echo ""
if [[ -f /var/lib/algorand/logging.config ]]; then
echo "Migrating telemetry configuration"
Expand All @@ -30,10 +29,12 @@ if [[ -f /var/lib/algorand/logging.config ]]; then
fi
fi

echo "Stopping Voi.service if available"
echo "Stopping services and uninstalling previous installation"
execute_sudo "systemctl stop voi"
execute_sudo "systemctl disable voi"
echo "If you want to revert to D13 based setup on this host, you can start the service again by running 'systemctl start voi && systemctl enable voi'"
execute_sudo "systemctl disable algorand"
execute_sudo "systemctl disable algorand"
execute_sudo "apt-get remove -y algorand"

echo "Start Voi Swarm"
bash -c "env VOINETWORK_TELEMETRY_NAME=$VOINETWORK_TELEMETRY_NAME docker stack deploy -c ${HOME}/voi/docker/compose.yml voinetwork"
Expand Down
2 changes: 1 addition & 1 deletion docs/installation/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export VOINETWORK_IMPORT_ACCOUNT=1
```

???+ info
While the installation detects existing D13 based setups on the same host
While the installation detects existing host-based setups (such as D13) on the same host
and offers migration automatically,
it is important to familiarize yourself with the [migration steps](../../migrating/) in particular
if you are [migrating from a different host](../../migrating/#installing-on-a-new-server).
10 changes: 6 additions & 4 deletions docs/migrating.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Migrating to Voi Swarm

## From D13 based setups
## From host-based based setups (including D13)

Install Voi Swarm on your server by importing your existing wallet using your mnemonic:

Expand All @@ -11,18 +11,20 @@ export VOINETWORK_IMPORT_ACCOUNT=1

=== "Installing on same server"

During the installation, the setup will detect existing D13 based setups on the same host and offer migration automatically.
During the installation, the setup will detect existing Voi and Algorand based setups on the same host and offer
migration automatically.

If you want to migrate manually after installation run this command:

```bash
~/voi/bin/migrate-from-d13-setup
~/voi/bin/migrate-from-host-setup
```

This command will do the following steps for you:

1. Duplicate telemetry settings, including existing telemetry name and GUID, without affecting rewards.
2. Stop the host-based Voi service
2. Stop the host-based Voi and Algorand services
3. Remove the Algorand debian package, to avoid conficts with the Voi Swarm setup
3. Restart Voi Swarm

=== "Installing on a new server"
Expand Down
10 changes: 5 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ set_telemetry_name() {
return
fi

detect_existing_host_based_voi_setup
detect_existing_host_based_setup

if [[ ${migrate_host_based_setup} -eq 1 ]]; then
return
Expand Down Expand Up @@ -524,11 +524,11 @@ set_telemetry_name() {
fi
}

detect_existing_host_based_voi_setup() {
detect_existing_host_based_setup() {
if [[ -f /var/lib/algorand/logging.config && ! -f /var/lib/voi/algod/data/logging.config ]]; then
echo "An existing Voi installation has been detected on your system."
echo "An existing Voi or Algorand installation has been detected on your system."
echo "We can migrate your existing telemetry configuration to Voi Swarm."
echo "As part of this process, we will also stop the existing service."
echo "As part of this process, we will also stop and uninstall the existing service."
echo "This is necessary to prevent conflicts and ensure that your node can join Voi Swarm as a healthy node."
echo ""
echo "Do you want to migrate your existing setup to Voi Swarm? (yes/no)"
Expand All @@ -549,7 +549,7 @@ migrate_host_based_voi_setup() {
if [[ ${migrate_host_based_setup} -eq 1 ]]; then
display_banner "Migrating from host based setup"
VOINETWORK_TELEMETRY_NAME=$(execute_sudo "cat /var/lib/algorand/logging.config" | jq -r '.Name')
bash -c "env VOINETWORK_TELEMETRY_NAME=\"${VOINETWORK_TELEMETRY_NAME}\" ${voi_home}/bin/migrate-from-d13-setup"
bash -c "env VOINETWORK_TELEMETRY_NAME=\"${VOINETWORK_TELEMETRY_NAME}\" ${voi_home}/bin/migrate-from-host-setup"
fi
}

Expand Down

0 comments on commit d050b7c

Please sign in to comment.