Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Idena Node Installation Script
#!/bin/bash
echo " _____ _ "
echo " |_ _| | | "
echo " | | __| | ___ _ __ __ _ "
echo " | | / _ | / _ \| _ \ / _ |"
echo " _| |_| (_| || __/| | | || (_| |"
echo " |_____|\__ _| \___||_| |_| \__ _|"
echo
echo "## Welcome to the Idena node installation script ##"
echo "-------------------------------------"
echo "https://myaltcoins.info/idena-review/"
echo "-------------------------------------"
echo
echo "## Checking Linux version and release ... "
distribution=$(lsb_release -is)
release=$(lsb_release -rs)
codename=$(lsb_release -cs)
if [[ ! $distribution =~ ("Debian"|"Ubuntu") ]]; then
echo "## Your distribution ($distribution) is not supported. Please install Ubuntu 18.04 LTS." && exit 1
fi
if [[ ! $codename =~ ("xenial"|"bionic"|"jessie"|"stretch"|"buster") ]]; then
echo "## Your release ($codename) of $distribution is not supported." && exit 1
fi
echo "## I have determined you are using $distribution $release."
echo
read -p "Enter '1' for node install or '2' for node update (use only if you used option '1' previously): " IDENA_TYPE
if [ $IDENA_TYPE -eq 1 ]
then
echo
echo "## Installing dependencies ... "
echo
sudo apt update -qq
sudo apt install -y htop nano curl
echo
echo "## Dependencies installed."
echo
echo "## Generating config and fetching latest node binary ... "
echo
cd && mkdir idena && cd idena
curl -s https://api.github.com/repos/idena-network/idena-go/releases/latest \
| grep browser_download_url \
| grep idena-node-linux-0.* \
| cut -d '"' -f 4 \
| wget -qi -
chmod +x idena-node-linux-0.*
bash -c 'echo "{ \"IpfsConf\": { \"Profile\": \"server\" } }" > config.json'
echo "## Running Idena node inside Screen session, sit tight ... "
screen -dmS idena ./idena-node-linux-0.* --config=config.json
sleep 4
echo
echo "## Screen session list:"
echo
screen -ls
echo
echo "###################################################################"
echo "Your Idena identity private key, store it in a safe place:"
cat ./datadir/keystore/nodekey ; echo
echo "###################################################################"
echo
echo "###################################################################"
echo "Idena API key, save and enter it in client settings:"
cat ./datadir/api.key ; echo
echo "###################################################################"
echo
echo "## Now you can install Idena client on your PC and setup port forwarding:"
echo "## - client DL link: https://github.com/idena-network/idena-desktop/releases/latest"
echo "## - port forwarding instructions (use 9009 for both ports): https://idena.io/?view=guide#guide-remote-2"
echo "## - Idena FAQ: https://idena.io/?view=faq"
else
echo
echo "## Updating Idena node ... "
screen -X -S idena quit
cd && cd idena
rm idena-node-linux-0.*
curl -s https://api.github.com/repos/idena-network/idena-go/releases/latest \
| grep browser_download_url \
| grep idena-node-linux-0.* \
| cut -d '"' -f 4 \
| wget -qi -
chmod +x idena-node-linux-0.*
screen -dmS idena ./idena-node-linux-0.* --config=config.json
sleep 4
echo
echo "## Idena node updated."
echo
echo "## Check below if the node is running:"
echo
screen -ls
fi
echo
echo "------------------------------------"
echo "Thanks for using my services, human."
echo "------------------------------------"
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.