Difference between revisions of "BoS Telegram AutoStart"

From PlebNet Wiki
Jump to navigation Jump to search
(Marked this version for translation)
 
(5 intermediate revisions by one other user not shown)
Line 5: Line 5:


<!--T:2-->
<!--T:2-->
The following guide works on every linux distribution with the Systemd Software Manager Tool. I tested in with a Raspiblitz setup, but if you follow the installation process of the BoS tool, it should also work without problems on umbrel.
The following guide works on every linux distribution with the Systemd Software Manager Tool. I tested in with a Raspiblitz setup and the community tested it on umbrel. There are only some minor changes for the Umbrel setup, therefore two code snippets are shown. First is for Raspiblitz second for Umbrel.
(Everything can also be found in my git repo [https://github.com/ziggie1984/miscellanous.git gitrepo]).
(Everything can also be found in my git repo [https://github.com/ziggie1984/miscellanous.git gitrepo]).
(''If you have problems or find errors: Telegram @ziggiesmoke'')




Line 35: Line 37:
<!--T:7-->
<!--T:7-->
[Service]  
[Service]  
ExecStart=/home/bos/.npm-global/bin/bos telegram --connect VERBINDUNGSCODE
ExecStart=/home/bos/.npm-global/bin/bos telegram --connect CONNECTIONCODE
User=bos
User=bos
Restart=always
Restart=always
Line 45: Line 47:
<!--T:8-->
<!--T:8-->
[Install]
[Install]
WantedBy=multi-user.target  </code>
WantedBy=multi-user.target   
</pre>
</pre>
* Save file and then type the following command in the terminal: sudo systemctl enable bos-telegram.service
* Save file and then type the following command in the terminal: <code> sudo systemctl enable bos-telegram.service </code>
* Reboot your node
* Reboot your node or it also works without rebooting by using this command: <code> sudo systemctl start bos-telegram.service </code>
* wait until your telegram bot shows the new connection to check whether the service is running properly you can type: sudo systemctl status bos-telegram.service. Remember lighting needs to be up and unlocked before the bot is able to start.
* wait until your telegram bot shows the new connection to check whether the service is running properly you can type: sudo systemctl status bos-telegram.service. Remember lighting needs to be up and unlocked before the bot is able to start.


<!--T:9-->
===Checklist for Umbrel=== <!--T:5-->
''Please give a feedback on Telegram if the guide worked for you with umbrel, @ziggiesmoke''
 
<!--T:6-->
* Open Terminal
* Login via ssh: ssh umbrel@umbrel.local
It will ask your password. Use same password as when you log in via your browser (default password is moneyprintergobrrr but you probably have changed it already). NB: password is not visible when you tap or paste it.
* Change to the following directory: cd /etc/systemd/system/
* Create a so called unit-file: sudo touch bos-telegram.service
* Open file with: sudo nano bos-telegram.service
* Copy the following content into it, change CONNECTIONCODE with your own code that you got when you connected your bot:
<pre>
#Systemd unit for Bos-Telegram Bot
#/etc/systemd/system/bos-telegram.service
[Unit]
Description=bos-telegram
Wants=lnd.service
After=lnd.service
 
 
<!--T:10-->
[Service]
ExecStart=/home/umbrel/.npm-global/bin/bos telegram --connect CONNECTIONCODE
User=umbrel
Restart=always
TimeoutSec=120
RestartSec=30
StandardOutput=null
StandardError=journal
 
<!--T:11-->
[Install]
WantedBy=multi-user.target 
</pre>
* Save file and exit: ctrl + x
y enter
* Reboot your node OR use this command without rebooting: sudo systemctl start bos-telegram.service
* Wait until your Telegram bot shows the new connection (check the Telegram app for message ‘connected to…’).
* To check whether the service is running properly you can type: sudo systemctl status bos-telegram.service. Remember lighting needs to be up and unlocked before the bot is able to start.
* All good, you can close Terminal
</translate>
</translate>

Latest revision as of 21:08, 8 November 2021

Other languages:
English

Creating BoS Telegram AutoStart

The following guide works on every linux distribution with the Systemd Software Manager Tool. I tested in with a Raspiblitz setup and the community tested it on umbrel. There are only some minor changes for the Umbrel setup, therefore two code snippets are shown. First is for Raspiblitz second for Umbrel. (Everything can also be found in my git repo gitrepo).

(If you have problems or find errors: Telegram @ziggiesmoke)


Prerequesties

BoS has already been installed and an initial connection with your telegram bot has been established. Because if we want to put the bos telegram connection into the startup routine the API-Key of the Bot should already been entered.


Checklist for Raspiblitz

  • Login via ssh: ssh admin@ip.ip.ip.ip
  • Change to the following directory: cd /etc/systemd/system/
  • Create a so called unit-file: sudo touch bos-telegram.service
  • open file with: sudo nano bos-telegram.service
  • copy the following content into it, change CONNECTIONCODE with your own code:
#Systemd unit for Bos-Telegram Bot
#/etc/systemd/system/bos-telegram.service
[Unit]
Description=bos-telegram
Wants=lnd.service 
After=lnd.service 


[Service] 
ExecStart=/home/bos/.npm-global/bin/bos telegram --connect CONNECTIONCODE 
User=bos
Restart=always
TimeoutSec=120
RestartSec=30
StandardOutput=null
StandardError=journal

[Install]
WantedBy=multi-user.target  
  • Save file and then type the following command in the terminal: sudo systemctl enable bos-telegram.service
  • Reboot your node or it also works without rebooting by using this command: sudo systemctl start bos-telegram.service
  • wait until your telegram bot shows the new connection to check whether the service is running properly you can type: sudo systemctl status bos-telegram.service. Remember lighting needs to be up and unlocked before the bot is able to start.

Checklist for Umbrel

  • Open Terminal
  • Login via ssh: ssh umbrel@umbrel.local

It will ask your password. Use same password as when you log in via your browser (default password is moneyprintergobrrr but you probably have changed it already). NB: password is not visible when you tap or paste it.

  • Change to the following directory: cd /etc/systemd/system/
  • Create a so called unit-file: sudo touch bos-telegram.service
  • Open file with: sudo nano bos-telegram.service
  • Copy the following content into it, change CONNECTIONCODE with your own code that you got when you connected your bot:
#Systemd unit for Bos-Telegram Bot
#/etc/systemd/system/bos-telegram.service
[Unit]
Description=bos-telegram
Wants=lnd.service 
After=lnd.service 


[Service] 
ExecStart=/home/umbrel/.npm-global/bin/bos telegram --connect CONNECTIONCODE 
User=umbrel
Restart=always
TimeoutSec=120
RestartSec=30
StandardOutput=null
StandardError=journal

[Install]
WantedBy=multi-user.target  
  • Save file and exit: ctrl + x

y enter

  • Reboot your node OR use this command without rebooting: sudo systemctl start bos-telegram.service
  • Wait until your Telegram bot shows the new connection (check the Telegram app for message ‘connected to…’).
  • To check whether the service is running properly you can type: sudo systemctl status bos-telegram.service. Remember lighting needs to be up and unlocked before the bot is able to start.
  • All good, you can close Terminal