Skip to content

BREAKING CHANGE: drop Node.js 18 #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions tools/fix_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

printf "\n"
printf "Greetings!\n"
printf "Ensure you got this file from the adamant.im website or GitHub.\n"
printf "Use this node repair tool v1.0 if your ADM node lost the current blockchain height and restarted, rising from the beginning.\n"
printf "Though validating blocks from 0 height is a decent option, catching up with the current height may take time.\n"
printf "If your node is a forging delegate, you probably prefer using an up-to-date blockchain image and enabling it back in ten minutes.\n"
printf "This script deletes the ADM blockchain database, downloads its fresh image, and restarts the node.\n"
printf "We still recommend consulting an IT specialist if you are unfamiliar with Linux systems.\n"
printf "Alternatively, follow these steps manually. Also, see full node installation instructions at https://news.adamant.im/how-to-run-your-adamant-node-on-ubuntu-990e391e8fcc.\n\n"
printf "Please make sure you obtained this file from the adamant.im website or GitHub.\n"
printf "Use this Node Repair Tool v1.0.1 if your ADM node has lost sync and restarted from the beginning of the blockchain.\n"
printf "While validating blocks from height 0 is a valid option, catching up to the current height can take a long time.\n"
printf "If your node is a forging delegate, you’ll likely prefer using an up-to-date blockchain image to restore it within ten minutes.\n"
printf "This script will delete the ADM blockchain database, download a fresh image, and restart your node.\n"
printf "We still recommend consulting an IT specialist if you are not familiar with Linux systems.\n"
printf "Alternatively, you can perform these steps manually. Full node installation instructions are available at:\n"
printf "https://news.adamant.im/how-to-run-your-adamant-node-on-ubuntu-990e391e8fcc\n\n"

read -r -p "WARNING! Use the script only if you initially set up the node using the ADAMANT node installer, as it expects a specific server environment. Run it under the root user. If you agree to continue, type \"yes\": " agreement
if [[ $agreement != "yes" ]]
Expand Down Expand Up @@ -74,10 +75,10 @@ pm2 restart adamant

EOSU

printf "\n\nFinished the ADAMANT '%s' node repair script. Executed in %s seconds.\n" "$network" "$SECONDS"
printf "Check your node status with 'pm2 show adamant' command.\n"
printf "Current node's height: 'curl http://localhost:%s/api/blocks/getHeight'\n" "$port"
printf "Thank you for supporting true decentralized ADAMANT Messenger.\n\n"
printf "\n\nADAMANT '%s' node repair script completed. Total execution time: %s seconds.\n" "$network" "$SECONDS"
printf "Check your node status with the command: 'pm2 show adamant'\n"
printf "To check the current node height, run: 'curl http://localhost:%s/api/blocks/getHeight'\n" "$port"
printf "Thank you for supporting the truly decentralized ADAMANT Messenger.\n\n"

read -n1 -r -p "Press any key to continue…"

Expand Down
52 changes: 26 additions & 26 deletions tools/install_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ databasename="adamant_main"
configfile="config.json"
processname="adamant"
port="36666"
nodejs="hydrogen"
nodejs="jod"

while getopts 'b:n:j:' OPTION; do
OPTARG=$(echo "$OPTARG" | xargs)
Expand All @@ -31,12 +31,12 @@ while getopts 'b:n:j:' OPTION; do
fi
;;
j)
if [ "$OPTARG" == "16" ] || [ "$OPTARG" == "gallium" ]
if [ "$OPTARG" == "20" ] || [ "$OPTARG" == "iron" ]
then
nodejs="gallium"
elif [ "$OPTARG" != "18" ] && [ "$OPTARG" != "hydrogen" ]
nodejs="iron"
elif [ "$OPTARG" != "22" ] && [ "$OPTARG" != "jod" ]
then
printf "\nNodejs should be 'gallium' = '16', or 'hydrogen' = '18'.\n\n"
printf "\nNodejs should be 'iron' = '20', or 'jod' = '22'.\n\n"
exit 1
fi
;;
Expand All @@ -48,18 +48,19 @@ while getopts 'b:n:j:' OPTION; do
done

printf "\n"
printf "Welcome to the ADAMANT node installer v2.1.3 for Ubuntu 20, 22. Make sure you got this file from adamant.im website or GitHub.\n"
printf "This installer is the easiest way to run ADAMANT node. We still recommend to consult IT specialist if you are not familiar with Linux systems.\n"
printf "You can see full installation instructions on https://news.adamant.im/how-to-run-your-adamant-node-on-ubuntu-990e391e8fcc.\n"
printf "The installer will ask you to set database and user passwords during the installation.\n"
printf "Also, the system may ask to choose some parameters, like encoding, keyboard, and grub. Generally, you can leave them by default.\n\n"

printf "Note: You've chosen '%s' network.\n" "$network"
printf "Note: You've chosen '%s' branch.\n" "$branch"
printf "Note: You've chosen '%s' Nodejs version.\n" "$nodejs"
printf "Welcome to the ADAMANT Node Installer v2.2.0 for Ubuntu 20, 22, and 24.\n"
printf "Make sure you obtained this file from the adamant.im website or GitHub.\n"
printf "This installer is the easiest way to run an ADAMANT node. However, we still recommend consulting an IT specialist if you are not familiar with Linux systems.\n"
printf "You can find full installation instructions at:\nhttps://news.adamant.im/how-to-run-your-adamant-node-on-ubuntu-990e391e8fcc\n"
printf "The installer will prompt you to set database and user passwords during installation.\n"
printf "The system may also ask you to choose parameters such as encoding, keyboard layout, or GRUB settings. In most cases, you can leave them at their default values.\n\n"

printf "Note: You have selected the '%s' network.\n" "$network"
printf "Note: You have selected the '%s' branch.\n" "$branch"
printf "Note: You have selected Node.js version '%s'.\n" "$nodejs"
printf "\n"

read -r -p "WARNING! Running this script is recommended for new droplets. Existing data MAY BE DAMAGED. If you agree to continue, type \"yes\": " agreement
read -r -p "WARNING! This script is intended for new droplets. Existing data MAY BE DAMAGED. If you agree to continue, type \"yes\": " agreement
if [[ $agreement != "yes" ]]
then
printf "\nInstallation cancelled.\n\n"
Expand All @@ -69,16 +70,16 @@ fi
IMAGE=false
if [[ $network == "mainnet" ]]
then
printf "\nBlockchain image saves time on node sync but you must completely trust the image.\n"
printf "If you skip this step, your node will check every single transaction, which takes time (up for several days).\n"
read -r -p "Do you want to use the ADAMANT blockchain image to bootstrap a node? [Y/n]: " useimage
printf "\nUsing a blockchain image can significantly reduce sync time, but you must fully trust its source.\n"
printf "If you skip this step, your node will verify every single transaction, which may take several days.\n"
read -r -p "Do you want to use the ADAMANT blockchain image to bootstrap the node? [Y/n]: " useimage
case $useimage in
[yY][eE][sS]|[yY]|[jJ]|'')
IMAGE=true
printf "\nI'll download blockchain image and your node will be on the actual height in a few minutes.\n\n"
printf "\nThe blockchain image will be downloaded, and your node will reach the current height within a few minutes.\n\n"
;;
*)
printf "\nI'll sync your node from the beginning. It may take several days to raise up to the actual blockchain height.\n\n"
printf "\nThe node will synchronize from scratch. This process may take several days to reach the current blockchain height.\n\n"
;;
esac
fi
Expand Down Expand Up @@ -144,7 +145,7 @@ su - "$username" <<EOSU

#NodeJS
printf "\n\nInstalling nvm & node.js…\n\n"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
source ~/.nvm/nvm.sh
source ~/.profile
source ~/.bashrc
Expand Down Expand Up @@ -211,10 +212,10 @@ adamant_startup_output=$(su - adamant -c "source ~/.nvm/nvm.sh; pm2 startup")
adamant_startup=$(echo "$adamant_startup_output" | grep -oP 'sudo env PATH=.*')
bash -c "$adamant_startup"

printf "\n\nFinished ADAMANT '%s' node installation script. Executed in %s seconds.\n" "$network" "$SECONDS"
printf "Check your node status with 'pm2 show %s' command.\n" "$processname"
printf "Current node's height: 'curl http://localhost:%s/api/blocks/getHeight'\n" "$port"
printf "Thank you for supporting true decentralized ADAMANT Messenger.\n\n"
printf "\n\nADAMANT '%s' node installation completed. Total execution time: %s seconds.\n" "$network" "$SECONDS"
printf "Check your node status with the command: 'pm2 show %s'\n" "$processname"
printf "To check the current node height, run: 'curl http://localhost:%s/api/blocks/getHeight'\n" "$port"
printf "Thank you for supporting the truly decentralized ADAMANT Messenger.\n\n"

read -n1 -r -p "Press any key to continue…"

Expand All @@ -227,4 +228,3 @@ fi

#Works only if run not in screen
su - "$username"

51 changes: 26 additions & 25 deletions tools/install_node_centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ databasename="adamant_main"
configfile="config.json"
processname="adamant"
port="36666"
nodejs="hydrogen"
nodejs="jod"

while getopts 'b:n:j:' OPTION; do
OPTARG=$(echo "$OPTARG" | xargs)
Expand All @@ -31,12 +31,12 @@ while getopts 'b:n:j:' OPTION; do
fi
;;
j)
if [ "$OPTARG" == "16" ] || [ "$OPTARG" == "gallium" ]
if [ "$OPTARG" == "20" ] || [ "$OPTARG" == "iron" ]
then
nodejs="gallium"
elif [ "$OPTARG" != "18" ] && [ "$OPTARG" != "hydrogen" ]
nodejs="iron"
elif [ "$OPTARG" != "22" ] && [ "$OPTARG" != "jod" ]
then
printf "\nNodejs should be 'gallium' = '16', or 'hydrogen' = '18'.\n\n"
printf "\nNodejs should be 'iron' = '20', or 'jod' = '22'.\n\n"
exit 1
fi
;;
Expand All @@ -48,18 +48,19 @@ while getopts 'b:n:j:' OPTION; do
done

printf "\n"
printf "Welcome to the ADAMANT node installer v2.1.3 for CentOS 8. Make sure you got this file from adamant.im website or GitHub.\n"
printf "This installer is the easiest way to run ADAMANT node. We still recommend to consult IT specialist if you are not familiar with Linux systems.\n"
printf "You can see full installation instructions (though for Ubuntu) on https://news.adamant.im/how-to-run-your-adamant-node-on-ubuntu-990e391e8fcc.\n"
printf "The installer will ask you to set database and user passwords during the installation.\n"
printf "Also, the system may ask to choose some parameters, like encoding, keyboard, and grub. Generally, you can leave them by default.\n\n"

printf "Note: You've chosen '%s' network.\n" "$network"
printf "Note: You've chosen '%s' branch.\n" "$branch"
printf "Note: You've chosen '%s' Nodejs version.\n" "$nodejs"
printf "Welcome to the ADAMANT Node Installer v2.2.0 for CentOS 8.\n"
printf "Please ensure you obtained this file from the adamant.im website or GitHub.\n"
printf "This installer is the easiest way to run an ADAMANT node. However, we still recommend consulting an IT specialist if you are not familiar with Linux systems.\n"
printf "You can find full installation instructions (for Ubuntu) at:\nhttps://news.adamant.im/how-to-run-your-adamant-node-on-ubuntu-990e391e8fcc\n"
printf "During installation, you will be asked to set database and user passwords.\n"
printf "The system may also prompt you to choose parameters such as encoding, keyboard layout, and GRUB settings. You can generally leave the defaults.\n\n"

printf "Note: You have selected the '%s' network.\n" "$network"
printf "Note: You have selected the '%s' branch.\n" "$branch"
printf "Note: You have selected Node.js version '%s'.\n" "$nodejs"
printf "\n"

read -r -p "WARNING! Running this script is recommended for new droplets. Existing data MAY BE DAMAGED. If you agree to continue, type \"yes\": " agreement
read -r -p "WARNING! This script is intended for new droplets. Existing data MAY BE DAMAGED. If you agree to continue, type \"yes\": " agreement
if [[ $agreement != "yes" ]]
then
printf "\nInstallation cancelled.\n\n"
Expand All @@ -69,16 +70,16 @@ fi
IMAGE=false
if [[ $network == "mainnet" ]]
then
printf "\nBlockchain image saves time on node sync but you must completely trust the image.\n"
printf "If you skip this step, your node will check every single transaction, which takes time (up for several days).\n"
read -r -p "Do you want to use the ADAMANT blockchain image to bootstrap a node? [Y/n]: " useimage
printf "\nUsing a blockchain image can significantly reduce sync time, but you must fully trust its source.\n"
printf "If you skip this step, your node will verify every single transaction, which can take several days.\n"
read -r -p "Do you want to use the ADAMANT blockchain image to bootstrap the node? [Y/n]: " useimage
case $useimage in
[yY][eE][sS]|[yY]|[jJ]|'')
IMAGE=true
printf "\nI'll download blockchain image and your node will be on the actual height in a few minutes.\n\n"
printf "\nThe blockchain image will be downloaded, and your node will reach the current height in a few minutes.\n\n"
;;
*)
printf "\nI'll sync your node from the beginning. It may take several days to raise up to the actual blockchain height.\n\n"
printf "\nYour node will sync from scratch. This process may take several days to reach the current blockchain height.\n\n"
;;
esac
fi
Expand Down Expand Up @@ -146,7 +147,7 @@ su - "$username" <<EOSU

#NodeJS
printf "\n\nInstalling nvm & node.js…\n\n"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
source ~/.nvm/nvm.sh
source ~/.profile
source ~/.bashrc
Expand Down Expand Up @@ -214,8 +215,8 @@ fi

EOSU

printf "\n\nFinished ADAMANT '%s' node installation script. Executed in %s seconds.\n" "$network" "$SECONDS"
printf "Check your node status with 'pm2 show %s' command.\n" "$processname"
printf "Current node's height: 'curl http://localhost:%s/api/blocks/getHeight'\n" "$port"
printf "Thank you for supporting true decentralized ADAMANT Messenger.\n\n"
printf "\n\nADAMANT '%s' node installation script completed. Execution time: %s seconds.\n" "$network" "$SECONDS"
printf "Check your node status with the command: 'pm2 show %s'\n" "$processname"
printf "To check the current node height, run: 'curl http://localhost:%s/api/blocks/getHeight'\n" "$port"
printf "Thank you for supporting the truly decentralized ADAMANT Messenger.\n\n"
su - "$username"