nix-bitcoin icon indicating copy to clipboard operation
nix-bitcoin copied to clipboard

Add support for core lightning watchtower TEoS (The Eye of Satoshi) - server and client

Open seberm opened this issue 1 year ago • 11 comments

This MR adds basic support for rust-teos - package, module and clightning watchtower plugin.

Fixes: #540

TODO(s):

  • [x] https://github.com/talaia-labs/rust-teos/issues/116
  • [x] https://github.com/talaia-labs/rust-teos/issues/119
  • [x] https://github.com/NixOS/nixpkgs/pull/195782
  • [x] https://github.com/fort-nix/nix-bitcoin/pull/560

seberm avatar Aug 30 '22 20:08 seberm

Hello @erikarvstedt , would you mind to take a look and give me some initial review?

seberm avatar Sep 08 '22 14:09 seberm

I think it makes sense to add teos package directly into nixpkgs and a teos module maintain here in nix-bitcoin:

  • https://github.com/NixOS/nixpkgs/pull/195782

seberm avatar Oct 13 '22 09:10 seberm

I think you are right. Good catch!

I've made the recommended changes. Could you please help me with the testing? I have currently my test environment somehow broken.

Thanks!

seberm avatar Jun 28 '23 18:06 seberm

I am just testing the teosd setup for now, but not the watchtower plugin for c-lightning.

3cola avatar Jun 28 '23 19:06 3cola

Hello @3cola , I am continuing the work on integration of TEoS into nix-bitcoin (https://github.com/seberm/nix-bitcoin/tree/feature/add-rust-teos-v4).

Commonly used by teos is the port 2121, like this: ....

It seems the TEoS changed the default port for onion from 2121 to match the clearnet one (9814). Do you think we really still want to use the 2121?

I think we should follow the upstream and keep this port set to 9814 for both - clearnet and onion.

seberm avatar Oct 09 '23 20:10 seberm

I've moved the api configuration section to the top level so it is now correctly loaded by onionServices. The port and address options from top-level were moved under the rpc namespace.

I've also added some documentation about the plugin usage when connecting to a tower behind the tor.

I still need to review the tests. I would like to:

  • [x] add some tests for watchtower plugin itself (e.g. register it with a local teos tower)
  • [x] and maybe add some basic tests for teos-cli (just make sure it will connect to the tower via local RPC)

I would be glad for your a review. Thanks!

seberm avatar Oct 09 '23 22:10 seberm

Hello @erikarvstedt @prusnak, would you mind helping with the review? Especially the integration into the nix-bitcoin codebase?

The tests are passing and I also deployed the teos service to my nix-bitcoin node and I did some tower registration requests using httpie over onion. From my point of view it seems the tower (teos), its client (teos-cli) and the cln plugin are working correctly.

It would be great if we could move this forward to getting this PR merged. Or would it be better to implement it as a flake?

Also, do you think that it makes sense to add watchtower's dataDir into the regular bulk data backups?

Thanks

seberm avatar Oct 15 '23 22:10 seberm

Hello @3cola , I am continuing the work on integration of TEoS into nix-bitcoin (https://github.com/seberm/nix-bitcoin/tree/feature/add-rust-teos-v4).

Commonly used by teos is the port 2121, like this: ....

It seems the TEoS changed the default port for onion from 2121 to match the clearnet one (9814). Do you think we really still want to use the 2121?

I think we should follow the upstream and keep this port set to 9814 for both - clearnet and onion.

I don't have an opinion on the choice of port number. If upstream is now using only 9814, we should follow.

3cola avatar Oct 17 '23 13:10 3cola

Any chance of getting this merged? I'll be glad for the review/comments and hints for improvement. Thanks! @erikarvstedt @jonasnick

seberm avatar May 14 '24 21:05 seberm

Thanks @seberm for your effort to keep this PR up to date!

I talked to Sergi, the main developer of teos, and he says that he isn't actively developing it but is planning to continue maintenance mode. He hasn't managed to make a new release so far and suggests to use master instead of the release.

So I don't think there is anything fundamental that's blocking this module as long as it is useful even in its current state. Needs review before it can get merged.

jonasnick avatar May 24 '24 17:05 jonasnick

Hello @jonasnick,

He hasn't managed to make a new release so far and suggests to use master instead of the release.

The teos package is now part of nixkpgs upstream. I am not sure if we can use the master branch directly there.

However, if Sergi recommends using the master branch, I can prepare a package overlay at least for nix-bitcoin.

For anyone interested in getting this merged, please test it and feel free to provide a review. I'll be glad to address any issues.

Thanks!

seberm avatar May 25 '24 07:05 seberm

Still running great on my side. I would love to see this in a release.

HaosGames avatar Jul 05 '24 13:07 HaosGames