Browse Source

Updating the script for the Antioch network

Pavel Surkov 3 years ago
parent
commit
82cd79f810

+ 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 https://raw.githubusercontent.com/Joystream/community-repo/master/community-contributions/scriptnodeSetup/joystream-node-install.sh -Oq -)"
 ```
 ```
 
 
 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

+ 29 - 40
community-contributions/scriptnodeSetup/joystream-node-install.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 #!/bin/bash
-#My public key 5EyRepuyZTM2rjHwbGfjBmjutaR5QTxLULcra2aToigtpxb6
-#My node name wasabi
-clear
+# My public key 5EyRepuyZTM2rjHwbGfjBmjutaR5QTxLULcra2aToigtpxb6
+# My node name wasabi
+
 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 "*      The script was created based on the official instructions and the   *"
@@ -9,45 +9,34 @@ echo "*      working community 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 "*      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/v7.5.0/joystream-node-3.3.0-fdb75f5ec-x86_64-linux-gnu.tar.gz
-tar -vxf joystream-node-3.3.0-fdb75f5ec-x86_64-linux-gnu.tar.gz
-wget https://github.com/Joystream/joystream/releases/download/v7.5.0/joy-testnet-4.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
-
-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
-
-echo ExecStart=$HOME/joystream-node \\| sudo tee --append /etc/systemd/system/joystream-node.service
-
-echo --chain joy-testnet-4.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
-
-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
 
 
+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
+
+printf "Enter your node name and press [ENTER]: "
+read NODENAME
+
+echo "[Unit]
+Description=Joystream Node
+After=network.target
+
+[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
+
+[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 -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"