Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspibolt without upnp #11

Open
giulnz opened this issue Mar 5, 2019 · 2 comments
Open

Raspibolt without upnp #11

giulnz opened this issue Mar 5, 2019 · 2 comments

Comments

@giulnz
Copy link

giulnz commented Mar 5, 2019

Hi, thanks for your guides,
In the new version of public ip script "RB_extra_02.md" , is it not necessary create corresponding systemd unit ?? see below

$ sudo nano /etc/systemd/system/getpublicip.service

RaspiBolt LND Mainnet: systemd unit for getpublicip.sh script

/etc/systemd/system/getpublicip.service

[Unit]
Description=getpublicip.sh: get public ip address from ipinfo.io
After=network.target

[Service]
User=root
Group=root
Type=simple
ExecStart=/usr/local/bin/getpublicip.sh
ExecStartPost=/bin/sleep 5
Restart=always

RestartSec=600
TimeoutSec=10

[Install]
WantedBy=multi-user.target
enable systemd startup
$ sudo systemctl enable getpublicip
$ sudo systemctl start getpublicip
$ sudo systemctl status getpublicip

Also is it not necessary to change this line in /etc/systemd/system/lnd.service ?

[Service]

get var PUBIP from file

EnvironmentFile=/run/publicip

ExecStart=/usr/local/bin/lnd --externalip=${PUBLICIP}
PIDFile=/home/bitcoin/.lnd/lnd.pid

@robclark56
Copy link
Owner

robclark56 commented Mar 6, 2019

guilnz:
LND v0.4.2: No. With the original lnd V0.4.2 Stadicus guides, he had the /usr/local/bin/getpublicip.sh script running every 10 mins. My script would notice that the IP address had changed, and restart lnd. No need to add your new systemd service in this case

LNV v0.5.x: Hmmm ... Stadicus uses the new feature in V0.5 where lnd queries the local (uPnP enabled) router and lnd itself manages the advertising of external IP. If you are running V0.5.2 with a router that does not support uPnP, then it is quite possible your new systemd service (or a cron job) is needed.

As mentioned in my extra "There is discussion among the lnd developers about adding a new lncli command to update the --externalip parameter without restarting lnd - which locks the wallet. Until that is implemented, the solution presented here is a stop-gap solution." That discussion concluded in lnd V0.5 being able to manage all this itself.

BTW ... I am on V0.5.2 so no longer use /usr/local/bin/getpublicip.sh at all

Hope that helps.

@giulnz
Copy link
Author

giulnz commented Mar 6, 2019

Hi , yes i have LND 0.5.2 and router without Upnp.
You right, your script need to run only at start .

Brief for people with same issue:
-same installation as Stadicus guide
-comment/delete nat=true line from lnd.conf
-add getpublicip script
-make it executable
-add getpublicip to cron (without RestartSec=600 TimeoutSec=10)
-add this 3 lines to lnd.service

EnvironmentFile=/run/publicip
ExecStart=/usr/local/bin/lnd --externalip=${PUBLICIP}
PIDFile=/home/bitcoin/.lnd/lnd.pid

I don't understand if "lnd" takes $PUBLICIP from "getpublicip" without this 3 lines.
Anyway like that it works so fine for me.

Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants