Bitcoin Forum

Bitcoin => Electrum => Topic started by: tublo on August 11, 2021, 07:07:43 PM



Title: Watchtower
Post by: tublo on August 11, 2021, 07:07:43 PM
I am trying to configure a watchtower based on https://electrum.readthedocs.io/en/latest/watchtower.html, but it is not working.
I don't really know what should I use as the watchtower address. I've tried some addresses, but the client were never able to see the watchtower. How is it supposed to work?


Title: Re: Watchtower
Post by: BitMaxz on August 11, 2021, 08:16:52 PM
If you follow the guide from the link you posted above and properly configure the watchtower according to 2nd step
then you should use a URL like this https://myusername:mypassword@example.com:12345

Also, run it Electrum with -d as the guide said into the command prompt, not in the Electrum GUI.

If you have some error or it's not working you might have a problem setting up the SSL?


Title: Re: Watchtower
Post by: tublo on August 14, 2021, 08:38:13 PM
But do I need a domain in order to configure a watchtower? Why?


Title: Re: Watchtower
Post by: BitMaxz on August 14, 2021, 09:38:25 PM
But do I need a domain in order to configure a watchtower? Why?

I think you can use the localhost even without a domain, it only needs a domain if you want to monitor them on your own remote server.

Read this Electrum presentation for a demo on how to set the watchtower host and port below.

- https://www.electrum.org/talks/lightning/presentation.html#slide13


Title: Re: Watchtower
Post by: tublo on August 16, 2021, 12:39:17 PM
Based on this presentation, it seems very easy to configure. Apparently, SSL is not required in this case.
However, it still doesn't work for me.


Title: Re: Watchtower
Post by: nc50lc on August 19, 2021, 04:35:41 AM
I've setup a watchtower following the tutorial using localhost and it worked even without 'SSL Certificate' (only for localhost I believe),
I've used these options:
Code:
python electrum-4.1.5/run_electrum --testnet setconfig -o run_watchtower true
python electrum-4.1.5/run_electrum --testnet setconfig -o watchtower_user user
python electrum-4.1.5/run_electrum --testnet setconfig -o watchtower_password password
python electrum-4.1.5/run_electrum --testnet setconfig -o watchtower_address 127.0.0.1:9735

Which is saved in the config file as:
Code:
        "run_watchtower": true,
       "watchtower_user": "user",
       "watchtower_password": "password",
       "watchtower_address": "127.0.0.1:9735"

Run electrum as daemon.

Lastly, in the client, "Tools->Preferences->'Lightning' tab->Use a remote watchtower" enable it but leave it blank.

it's on testnet BTW:
https://i.imgur.com/r5JvXUe.png
It's not updating real-time at my end, I have to close the 'local watchtower window' and open it again to update the list.
And newly opened channels wont show up unless Electrum client restarts, done 1 lightning transaction or it's just me.


Title: Re: Watchtower
Post by: tublo on August 21, 2021, 06:20:08 PM
When I try as nc50lc suggested, removing "https://" from the address, I get the following error message in the client:

Code:
E | lnworker.LNWallet.[LN] | Exception in sync_with_remote_watchtower: TypeError("'NoneType' object is not subscriptable")
Traceback (most recent call last):
  File "/home/aaaa/.local/lib/python3.8/site-packages/electrum/util.py", line 1118, in wrapper
    return await func(*args, **kwargs)
  File "/home/aaaa/.local/lib/python3.8/site-packages/electrum/lnworker.py", line 697, in sync_with_remote_watchtower
    if not (parsed_url.scheme == 'https' or is_private_netaddress(parsed_url.hostname)):
  File "/home/aaaa/.local/lib/python3.8/site-packages/electrum/util.py", line 1371, in is_private_netaddress
    if host[0] == '[' and host[-1] == ']':  # IPv6
TypeError: 'NoneType' object is not subscriptable


Title: Re: Watchtower
Post by: nc50lc on August 22, 2021, 04:37:28 AM
When I try as nc50lc suggested, removing "https://" from the address, I get the following error message in the client:
I've checked my log, with "https://" it won't be able to contact the remote through the watchtower_url:
Code:
lnworker.LNWallet.[LNwallet] | could not contact remote watchtower https://user:password@127.0.0.1:9735
Without "https://", there's the same error; but, the watchtower recognized the client's channels either way.

I think "remote watchtower url" isn't necessary for localhost since the client and watchtower are both running in the same machine.
As long as "use_watchtower": true, is also in the config, it should work. (I'll edit the client setting in previous reply)

But to be sure: you can open an issue in Electrum's repository here: https://github.com/spesmilo/electrum/issues (https://github.com/spesmilo/electrum/issues)
And paste the errors when localhost is used as "watchtower_url" in the client.


Title: Re: Watchtower
Post by: KNK on September 06, 2021, 05:21:46 PM
Hi,
 i have configured my own watchtower with SSL and was able to connect to it from a remote desktop app, but there is no such option in mobile app on Android (is it removed?) and the lightning channel is shown, but with capacity 0.
 How do i use the same lightning channel from both desktop and mobile?


Title: Re: Watchtower
Post by: nc50lc on September 07, 2021, 04:13:24 AM
-snip- and the lightning channel is shown, but with capacity 0.
How do i use the same lightning channel from both desktop and mobile?
As far as I know, it isn't possible.
Once you've done a transaction using the other, the other one will be outdated and could end up being closed or worse, penalized by the other end of the channel if you try to force-close it.

-snip- but there is no such option in mobile app on Android (is it removed?)
I haven't explored the Android app's lightning feature but I can't find it in my Android Electrum either.


Title: Re: Watchtower
Post by: KNK on September 11, 2021, 08:03:20 AM
Still new to lightning, but after some more reading ...
Yes, it is not possible and the watchtower may only close the channel in case of breach.
By having the same seed on both mobile and desktop the channel appeared automagicaly so it can be force closed in case the mobile is lost.
My expectation was some sort of a mix between watchtower and a personal server running 24/7 on the desktop and the mobile client using the LN channels with a watching-only wallet (or different seed), but it seems this is not (yet) possible