nix-bitcoin
nix-bitcoin copied to clipboard
Add support for core lightning watchtower TEoS (The Eye of Satoshi) - server and client
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
Hello @erikarvstedt , would you mind to take a look and give me some initial review?
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
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!
I am just testing the teosd setup for now, but not the watchtower plugin for c-lightning.
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'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!
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
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 the2121
?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.
Any chance of getting this merged? I'll be glad for the review/comments and hints for improvement. Thanks! @erikarvstedt @jonasnick
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.
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!
Still running great on my side. I would love to see this in a release.