joystream-node-install.sh 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. #My public key 5EyRepuyZTM2rjHwbGfjBmjutaR5QTxLULcra2aToigtpxb6
  3. #My node name wasabi
  4. clear
  5. echo "****************************************************************************"
  6. echo "* This script will install and configure your Joystream node. *"
  7. echo "* The script was created based on the official instructions and the *"
  8. echo "* working community instructions: *"
  9. echo "* https://github.com/Joystream/helpdesk/tree/master/roles/validators *"
  10. echo "* https://seainvestments1.medium.com/b3608a8be10e *"
  11. echo "****************************************************************************"
  12. read -n 1 -s -r -p "Press any key to continue or CTRL+C to exit ... "
  13. GREEN='\033[0;32m' # ${GREEN}
  14. sudo apt-get update
  15. sudo rm /etc/systemd/system/joystream-node.service
  16. wget https://github.com/Joystream/joystream/releases/download/v7.5.0/joystream-node-3.3.0-fdb75f5ec-x86_64-linux-gnu.tar.gz
  17. tar -vxf joystream-node-3.3.0-fdb75f5ec-x86_64-linux-gnu.tar.gz
  18. wget https://github.com/Joystream/joystream/releases/download/v7.5.0/joy-testnet-4.json
  19. cd /etc/systemd/system
  20. sudo touch joystream-node.service
  21. read -p "Enter your node name and press [ENTER]:" username
  22. echo [Unit] | sudo tee --append /etc/systemd/system/joystream-node.service
  23. echo Description=Joystream Node | sudo tee --append /etc/systemd/system/joystream-node.service
  24. echo After=network.target | sudo tee --append /etc/systemd/system/joystream-node.service
  25. echo [Service] | sudo tee --append /etc/systemd/system/joystream-node.service
  26. echo Type=simple | sudo tee --append /etc/systemd/system/joystream-node.service
  27. echo User=$USER | sudo tee --append /etc/systemd/system/joystream-node.service
  28. echo WorkingDirectory=$HOME/ | sudo tee --append /etc/systemd/system/joystream-node.service
  29. echo ExecStart=$HOME/joystream-node \\| sudo tee --append /etc/systemd/system/joystream-node.service
  30. echo --chain joy-testnet-4.json \\| sudo tee --append /etc/systemd/system/joystream-node.service
  31. echo --pruning archive \\| sudo tee --append /etc/systemd/system/joystream-node.service
  32. echo --validator \\| sudo tee --append /etc/systemd/system/joystream-node.service
  33. echo --name $username \\| sudo tee --append /etc/systemd/system/joystream-node.service
  34. echo --telemetry-url '"'wss://telemetry.joystream.org/submit/ 0'"' \\| sudo tee --append /etc/systemd/system/joystream-node.service
  35. echo --telemetry-url '"'wss://telemetry.polkadot.io/submit/ 0'"' | sudo tee --append /etc/systemd/system/joystream-node.service
  36. echo Restart=on-failure | sudo tee --append /etc/systemd/system/joystream-node.service
  37. echo RestartSec=3 | sudo tee --append /etc/systemd/system/joystream-node.service
  38. echo LimitNOFILE=8192 | sudo tee --append /etc/systemd/system/joystream-node.service
  39. echo [Install] | sudo tee --append /etc/systemd/system/joystream-node.service
  40. echo WantedBy=multi-user.target | sudo tee --append /etc/systemd/system/joystream-node.service
  41. sudo systemctl daemon-reload
  42. sudo systemctl start joystream-node
  43. sudo systemctl enable joystream-node
  44. clear
  45. 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"