Browse Source

Merge pull request #183 from SurPaul/master

Updating the script for the Antioch network
Martin 3 years ago
parent
commit
812e260785

+ 3 - 9
community-contributions/scriptnodeSetup/README.md

@@ -1,14 +1,8 @@
 ## Installation with script
 ## Installation with script
 
 
-Login as root, then do:
-```
-Download joystream-node-install.sh
-
-chmod +x ./joystream-node-install.sh
-
-./joystream-node-install.sh
+Login as user, then do:
+```bash
+sh -c "$(wget -q https://raw.githubusercontent.com/Joystream/community-repo/master/community-contributions/scriptnodeSetup/joystream-node-install.sh -O -)"
 ```
 ```
 
 
 Script will install the node. At the end of the installation, it will ask you what to name your node.   
 Script will install the node. At the end of the installation, it will ask you what to name your node.   
-Works as root and user. 
-GIF file (how it works): https://imgur.com/a/lliuWZk

+ 23 - 37
community-contributions/scriptnodeSetup/joystream-node-install.sh

@@ -1,53 +1,39 @@
 #!/bin/bash
 #!/bin/bash
 #My public key 5EyRepuyZTM2rjHwbGfjBmjutaR5QTxLULcra2aToigtpxb6
 #My public key 5EyRepuyZTM2rjHwbGfjBmjutaR5QTxLULcra2aToigtpxb6
 #My node name 1497-wasabi
 #My node name 1497-wasabi
-clear
 echo "****************************************************************************"
 echo "****************************************************************************"
 echo "*      This script will install and configure your Joystream node.         *"
 echo "*      This script will install and configure your Joystream node.         *"
-echo "*      The script was created based on the official instructions and the   *"
-echo "*      working community instructions:                                     *"
+echo "*      The script was created based on the official instructions:          *"
 echo "*      https://github.com/Joystream/helpdesk/tree/master/roles/validators  *"
 echo "*      https://github.com/Joystream/helpdesk/tree/master/roles/validators  *"
-echo "*      https://seainvestments1.medium.com/b3608a8be10e                     *"
 echo "****************************************************************************"
 echo "****************************************************************************"
-read -n 1 -s -r -p "Press any key to continue or CTRL+C to exit ... "
-GREEN='\033[0;32m'      #  ${GREEN}
-sudo apt-get update
-sudo rm /etc/systemd/system/joystream-node.service
-wget https://github.com/Joystream/joystream/releases/download/v9.3.0/joystream-node-5.1.0-9d9e77751-x86_64-linux-gnu.tar.gz
-tar -vxf joystream-node-5.1.0-9d9e77751-x86_64-linux-gnu.tar.gz
-wget https://github.com/Joystream/joystream/releases/download/v9.3.0/joy-testnet-5.json
-
-cd /etc/systemd/system
-sudo touch joystream-node.service
-
-read -p "Enter your node name and press [ENTER]:" username
 
 
-echo [Unit] | sudo tee --append /etc/systemd/system/joystream-node.service
-echo Description=Joystream Node | sudo tee --append /etc/systemd/system/joystream-node.service
-echo After=network.target | sudo tee --append /etc/systemd/system/joystream-node.service
+cd
+wget -q https://github.com/Joystream/joystream/releases/download/v9.3.0/joystream-node-5.1.0-9d9e77751-x86_64-linux-gnu.tar.gz
+tar -vxf joystream-node-5.1.0-9d9e77751-x86_64-linux-gnu.tar.gz
+wget -q https://github.com/Joystream/joystream/releases/download/v9.3.0/joy-testnet-5.json
 
 
-echo [Service] | sudo tee --append /etc/systemd/system/joystream-node.service
-echo Type=simple | sudo tee --append /etc/systemd/system/joystream-node.service
-echo User=$USER | sudo tee --append /etc/systemd/system/joystream-node.service
-echo WorkingDirectory=$HOME/ | sudo tee --append /etc/systemd/system/joystream-node.service
+printf "Enter your node name and press [ENTER]: "
+read NODENAME
 
 
-echo ExecStart=$HOME/joystream-node \\| sudo tee --append /etc/systemd/system/joystream-node.service
+echo "[Unit]
+Description=Joystream Node
+After=network.target
 
 
-echo --chain joy-testnet-5.json \\| sudo tee --append /etc/systemd/system/joystream-node.service
-echo --pruning archive \\| sudo tee --append /etc/systemd/system/joystream-node.service
-echo --validator \\| sudo tee --append /etc/systemd/system/joystream-node.service
-echo --name $username \\| sudo tee --append /etc/systemd/system/joystream-node.service
-echo --telemetry-url '"'wss://telemetry.joystream.org/submit/ 0'"' \\| sudo tee --append /etc/systemd/system/joystream-node.service
-echo --telemetry-url '"'wss://telemetry.polkadot.io/submit/ 0'"' | sudo tee --append /etc/systemd/system/joystream-node.service
-echo Restart=on-failure | sudo tee --append /etc/systemd/system/joystream-node.service
-echo RestartSec=3 | sudo tee --append /etc/systemd/system/joystream-node.service
-echo LimitNOFILE=8192 | sudo tee --append /etc/systemd/system/joystream-node.service
+[Service]
+Type=simple
+User=$USER
+WorkingDirectory=$HOME
+ExecStart=$HOME/joystream-node --chain joy-testnet-5.json --pruning archive --validator --name $NODENAME --log runtime,txpool,transaction-pool,trace=sync
+Restart=on-failure
+RestartSec=3
+LimitNOFILE=10000
 
 
-echo [Install] | sudo tee --append /etc/systemd/system/joystream-node.service
-echo WantedBy=multi-user.target | sudo tee --append /etc/systemd/system/joystream-node.service
+[Install]
+WantedBy=multi-user.target" > joystream-node.service
 
 
+sudo mv joystream-node.service /etc/systemd/system/joystream-node.service
 sudo systemctl daemon-reload
 sudo systemctl daemon-reload
 sudo systemctl start joystream-node
 sudo systemctl start joystream-node
 sudo systemctl enable joystream-node
 sudo systemctl enable joystream-node
-clear
-echo -e "${GREEN}===============\nYour node is fully installed and running.\nNow go to the site (https://telemetry.polkadot.io/#list/Joystream) and find your node by the name you gave it.\n\nWait for complete synchronization and proceed to the next step - Validator Setup\n(read - https://github.com/Joystream/helpdesk/tree/master/roles/validators#validator-setup).\n===============\033[0m"
+
+echo "${GREEN}===============\nYour node is fully installed and running.\nNow go to the site (https://telemetry.joystream.org/#/Joystream) and find your node by the name you gave it.\n\nWait for complete synchronization and proceed to the next step - Validator Setup\n(read - https://github.com/Joystream/helpdesk/tree/master/roles/validators#validator-setup).\n===============\033[0m"