Upgrading to Quilibrium v2.0.2-p1 (Dusk) from versions .19 and older
For more better FAQ regarding the v2.0.2-p1 (Dusk), please refer to the Quilibrium Discourse Forum (link)
Complete upgrade script code block
This code block upgrades your node to v2.0.2-p1 (Dusk) from v1.4.19 and older, by doing the following:
- stopping the ceremonyclient service first
- making a backup of the entire .config folder on ~ folder
- deleting and recreating an empty ceremonyclient directory, in order to start afresh
- setting release OS, arch variables, and the current version variable
- Please adjust the variable values below (default os=linux, arch=amd64, current_version=1.4.19)
- IMPORTANT please adjust the variable value for current_version below. Change this to your node's current version.
- creating node folder, and downloading all required node-related files (binaries, .dgst and *.sig files)
- creating client folder, and downloading qclient binary
- copying your backed up .config directory inside node
- modifying the service configuration file
- starting the service again
# stop the service
echo "1. stopping the ceremonyclient service first..."
service ceremonyclient stop
echo "... ceremonyclient service stopped"
# make a backup of the whole .config folder on your root folder
echo "2. making a backup of the entire .config folder on ~ folder..."
cd ~
cp -r ~/ceremonyclient/node/.config ~/config
config_copy_status=$?
config_copy_message="Successful"
if [ $config_copy_status != 0 ]; then
config_copy_message="Unsuccessful"
fi
echo "... Copy Code: $config_copy_status - $config_copy_message"
echo "... backup of .config directory done"
# delete and remake the ceremonyclient directory
echo "3. deleting and recreating the ceremonyclient directory, in order to start afresh..."
if [ $config_copy_status != 0 ]; then
echo "... because backup of .config failed, only renaming ceremonyclient to ceremonyclient_old"
mv ceremonyclient ceremonyclient_old
else
echo "... because backup of .config is successful, proceeding with deleting ceremonyclient folder"
rm -rf ceremonyclient/
fi
mkdir ceremonyclient && cd ceremonyclient
echo "... deleted and recreated"
# setting release OS and arch variables
echo "4. setting release OS and arch and current version variables..."
release_os="linux"
release_arch="amd64"
current_version="1.4.19"
echo "... \$release_os set to \"$release_os\" and \$release_arch set to \"$release_arch\" and \$current_version set to \"$current_version\""
# create node directory and download all required node files (binaries, dgst, and sig files)
echo "5. creating node folder, and downloading all required node-related files (binaries, .dgst and *.sig files)..."
mkdir node && cd node
echo "... node folder recreated"
files=$(curl https://releases.quilibrium.com/release | grep $release_os-$release_arch)
for file in $files; do
version=$(echo "$file" | cut -d '-' -f 2)
if ! test -f "./$file"; then
curl "https://releases.quilibrium.com/$file" > "$file"
echo "... downloaded $file"
fi
done
chmod +x ./node-$version-$release_os-$release_arch
cd ..
echo "... download of required node files done"
# creating client directory for qclient
echo "6. creating client folder, and downloading qclient binary..."
mkdir client && cd client
echo "... client folder recreated"
files=$(curl https://releases.quilibrium.com/qclient-release | grep $release_os-$release_arch)
for file in $files; do
clientversion=$(echo "$file" | cut -d '-' -f 2)
if ! test -f "./$file"; then
curl "https://releases.quilibrium.com/$file" > "$file"
echo "... downloaded $file"
fi
done
chmod +x ./qclient-$clientversion-$release_os-$release_arch
cd ..
echo "... download of required qclient files done"
# copying your backed up .config directory inside node
echo "7. copying your backed up .config directory inside node..."
cp -r ~/config ~/ceremonyclient/node/.config
rm -rf ~/config
echo "... .config directory copied back in node folder"
# modifying the service configuration file
echo "8. modifying the service configuration file..."
sed -i "s/ExecStart=\/root\/ceremonyclient\/node\/node-$current_version-$release_os-$release_arch/ExecStart=\/root\/ceremonyclient\/node\/node-$version-$release_os-$release_arch/g" /lib/systemd/system/ceremonyclient.service
systemctl daemon-reload
echo "... replaced \"ExecStart=/root/ceremonyclient/node/node-$current_version-$release_os-$release_arch\" with \"ExecStart=/root/ceremonyclient/node/node-$version-$release_os-$release_arch\""
echo "... service configuration file updated"
# start the service again
echo "9. starting the service again..."
cd ~
service ceremonyclient start
echo "... service started"