Open giulnz opened 5 years ago
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.
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.
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
Also is it not necessary to change this line in /etc/systemd/system/lnd.service ?