-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script for migrating from local host D13 + allow name and guid ov…
…errides for set-telemetry-name (#27)
- Loading branch information
1 parent
f872439
commit c0fc3a5
Showing
4 changed files
with
140 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
is_root=0 | ||
|
||
execute_sudo() { | ||
if [[ ${is_root} -eq 1 ]]; then | ||
bash -c "$1" | ||
else | ||
sudo bash -c "$1" | ||
fi | ||
} | ||
|
||
container_id=$(docker ps -q -f name=voinetwork_algod) | ||
if [ -z "${container_id}" ]; then | ||
echo "AVM container is not running. Please start it first." | ||
exit 1 | ||
fi | ||
|
||
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 "" | ||
if [[ -f /var/lib/algorand/logging.config ]]; then | ||
echo "Migrating telemetry configuration" | ||
execute_sudo "cp /var/lib/algorand/logging.config /var/lib/voi/algod/data/logging.config" | ||
if [[ ${is_root} -eq 0 ]]; then | ||
execute_sudo "chgrp docker /var/lib/voi/algod/data/logging.config" | ||
fi | ||
fi | ||
|
||
echo "Stopping Voi.service if available" | ||
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'" | ||
|
||
echo "Start Voi Swarm" | ||
bash -c "env VOINETWORK_TELEMETRY_NAME=$VOINETWORK_TELEMETRY_NAME docker stack deploy -c ${HOME}/voi/docker/compose.yml voinetwork" | ||
|
||
echo "Changes has been applied to the network. Please wait a minute for the changes to take effect." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Migrating to Voi Swarm | ||
|
||
## From D13 based setups | ||
|
||
=== "Installing on same server" | ||
|
||
To help migrate from D13 based setups, there's a migration command available. This command will | ||
|
||
1. Duplicate telemetry settings, including existing telemetry name and GUID, without affecting rewards. | ||
2. Stop the host-based Voi service | ||
3. Restart Voi Swarm | ||
|
||
To run this command, you must install Voi Swarm first. Then run the following command: | ||
|
||
```bash | ||
~/voi/bin/migrate-from-d13-setup | ||
``` | ||
|
||
=== "Installing on a new server" | ||
|
||
To migrate to a new server, you must first install Voi Swarm on the new server. | ||
|
||
1. Run the following command on the old server to get the telemetry name and GUID: | ||
|
||
```bash | ||
sudo ALGORAND_DATA=/var/lib/algorand diagcfg telemetry status | ||
``` | ||
2. Copy the telemetry name and GUID to the new server. | ||
3. Run the following command on the new server to set the telemetry name and GUID: | ||
|
||
```bash | ||
~/voi/bin/set-telemetry-name <telemetry-name> <telemetry-guid> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters