Bash Script implementation of the Idena network node installation wizard.
Install multiple instances of the Idena-Go in a simple and user-friendly way.
Please make sure that you have a pure Ubuntu 20.04 installation. To install Idena node using this script, please folow these steps:
apt-get install -y git
installing git packagegit clone https://github.com/ltraveler/idena-runner.git
clone the repositorycd idena-runner
chmod +x idena_install.sh
to make the script executable./idena_install.sh
to run the script
- Multiple Idena instances installation: 1 user - 1 instance
- Import the existing private/node keys during the installation process
- Automatic updates crontask that can be schedulled during the installation process
- Uncomplicated Firewall (UFW) configuration and automatic port rules updates during the idena-node instance installaltion
- Possibility to install idena-go as a shared node with default recommended values
- Checking if the idena.service exists;
- Creating new user and password to run the Idena node daemon;
- Upgrading Ubuntu packages and installing all requiered dependecies;
- Downloading idena-go network node based on the version that user have entered. If the input is empty the script is downloading the latest one. The version history is available here;
- The script using pre-defined
config.json
file which can be changed during the installation process; - Installing Idena-go and running it based on the config.json file from the repository;
- Changing API and Private keys of the node to the custom ones if the user wants so;
- Creating cron job to check for idena-go updates ones once a day. You can specify the frequency during the installation process;
- Creating Idena Daemon and running it;
- Installing and running firewall based on SSH and IPFS port numbers.
- The script will add
--profile=shared
to the service file; - You can set the most important args:
BlockPinThreshold
,FlipPinThreshold
,AllFlipsLoadingTime
- Default values:
BlockPinThreshold
=0.3
FlipPinThreshold
=1
AllFlipsLoadingTime
=7200000000000
- Default values:
The script is creating a service daemon called idena. Which starts on the boot.
service idena_$username status
- to check the statusservice idena_$username restart
- to restart the serviceservice idena_$username stop
- to stop the serviceservice idena_$username start
- to start the service
*where $username is required instance username
Since version 0.3.0 the script could be run in silence mode (aka push installation).
All or part of the answers could be sent via flags and relevant arguments in the command line.
flags:
-u
or --username
- username
-p
or --password
- password in case of using -u
without -p
the password would be the same as username
-s
or --shared
- shared node installation
-v
or --version
- idena-go node client version or latest to download the latest one
-b
or --blockpinthreshold
- Block Pin Threshold if not set but -f
and/or -l
have been applied, the script will use the default recommended value [0.3
]
-f
or --flippinthreshold
- Flip Pin Threshold if not set but -b
and/or -l
have been applied, the script will use the default recommended value [1
]
-l
or --allflipsloadingtime
- All Flips Loading Time if not set but -b
and/or -f
have been applied, the script will use the default recommended value [7200000000000
]
-r
or --rpcport
- RPC Port aka HTTP Port
-i
or --ipfsport
- IPFS Port
-k
or --privatekey
- IDENA Private Key aka nodekey
-a
or --apikey
- IDENA Node API Key
-d
or --updatefreq
- Update frequency in CRON expression format
Apart from -s
or --shared
the rest of the flags need an argument inside '' (apostrophe)
For example:
./idena_install.sh -u 'ratel' -p 'ratel' -s -v 'latest' -b '0.3' -f '1' -l '7200000000000' -r '9189' -i '41283' -k '6e17f7490f7922f3224d41769ce5ed2a01030de69d77163a291a77e8280aad3' -a '33e32cd86ecfb3179e50208428541a1e' -d '0 0 * * *'
- Backup the private key (
/home/idena_instance_username/idena-go/datadir/keystore/nodekey
) - Backup the node api.key (
/home/idena_instance_username/idena-go/datadir/api.key
) - Run the latest version of the idena-runner script and put the same username that you have used to install the instance that you are trying to update. That will overwrite all required files. Attention: all files inside the idena-go folder will be permanently deleted.
service idena_$username stop
- to stop the updated instance.- Restore your private and API keys from the backup that you have made on the 1st step.
service idena_$username start
- to start the updated instance.
service idena_username stop
stopping idena user instance;pkill -u username
killing all processes related to the user;deluser --remove-home username
removing related to idena-go instance user and all his files and folders;rm /etc/cron.d/idena_update_username
removing cron idena-go update related task;rm /etc/systemd/system/idena_username.service
removing idena daemon service related to the instance that we are uninstalling;systemctl disable idena_username
disabling idena daemon service related to the instance that we are uninstallingsystemctl daemon-reload
andsystemctl reset-failed
updating systemctl changes that we have made in the previous step;ufw show added | grep "IDENA Instance for user $username" | awk '{ gsub("ufw","ufw delete",$0); system($0)}'
do not forget to replace$username
to the real name of deleted user;sudo visudo
you have to find and delete the line related to the deleted user at the end of the file;nano /etc/ssh/sshd_config
- you have to delete username from DenyUsers group;sudo sshd -t
- to be sure that your latest changes of sshd_config file is correct;sudo service sshd restart
- to restart sshd daemon.
0xf041640788910fc89a211cd5bcbf518f4f14d831
- All donations are welcomed and appreciated;
- If you are looking for a stable shared node service, please contact me on Telegram
@ltrvlr
- Email
[email protected]
- Telegram
@ltrvlr
For more detailed information about idena-go client please check the official idena-go github repository.