diff --git a/.cirrus.yml b/.cirrus.yml index fbbf47e..2e3bf31 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -27,6 +27,7 @@ task: - scenario: default - scenario: netns - scenario: netnsRegtest + - scenario: trustedcoin # This script is run as root build_script: - echo "sandbox = true" >> /etc/nix/nix.conf diff --git a/README.md b/README.md index 0c5f2d8..ba24157 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ NixOS modules ([src](modules/modules.nix)) * [prometheus](https://github.com/lightningd/plugins/tree/master/prometheus): lightning node exporter for the prometheus timeseries server * [rebalance](https://github.com/lightningd/plugins/tree/master/rebalance): keeps your channels balanced * [summary](https://github.com/lightningd/plugins/tree/master/summary): print a nice summary of the node status + * [trustedcoin](https://github.com/nbd-wtf/trustedcoin) [[experimental](docs/services.md#trustedcoin-hints)]: replaces bitcoind with trusted public explorers * [zmq](https://github.com/lightningd/plugins/tree/master/zmq): publishes notifications via ZeroMQ to configured endpoints * [clightning-rest](https://github.com/Ride-The-Lightning/c-lightning-REST): REST server for clightning * [lnd](https://github.com/lightningnetwork/lnd) with support for announcing an onion service and [static channel backups](https://github.com/lightningnetwork/lnd/blob/master/docs/recovery.md) diff --git a/docs/services.md b/docs/services.md index d677b57..af692df 100644 --- a/docs/services.md +++ b/docs/services.md @@ -621,3 +621,27 @@ services.clightning = { ``` Please have a look at the module for a plugin (e.g. [prometheus.nix](../modules/clightning-plugins/prometheus.nix)) to learn its configuration options. + +### Trustedcoin hints +The [trustedcoin](https://github.com/nbd-wtf/trustedcoin) plugin use a Tor +proxy for all of its external connections by default. That's why you can +sometimes face issues with your connections to esploras getting blocked. + +An example of clightning log error output in a case your connections are getting blocked: + +``` +lightningd[5138]: plugin-trustedcoin estimatefees error: https://blockstream.info/api error: 403 Forbidden +``` + +``` +lightningd[4933]: plugin-trustedcoin getblock error: got something that isn't a block hash: +lightningd[4933]: /dev/null +cd trustedcoin + +echo "tag: $latest" +git checkout -q "tags/$latest" +rm -rf .git +nix --extra-experimental-features nix-command hash path . diff --git a/test/tests.nix b/test/tests.nix index 2501ef6..ba4fa4c 100644 --- a/test/tests.nix +++ b/test/tests.nix @@ -45,7 +45,7 @@ let services.clightning.extraConfig = mkIf config.test.noConnections "disable-dns"; test.data.clightning-plugins = let plugins = config.services.clightning.plugins; - removed = [ "commando" ]; + removed = [ "commando" "trustedcoin" ]; enabled = builtins.filter (plugin: plugins.${plugin}.enable) (subtractLists removed (builtins.attrNames plugins)); nbPkgs = config.nix-bitcoin.pkgs; @@ -315,6 +315,15 @@ let services.lnd.enable = true; services.bitcoind.prune = 1000; }; + + # Test the special clightning setup where trustedcoin plugin is used + trustedcoin = { + tests.trustedcoin = true; + services.clightning = { + enable = true; + plugins.trustedcoin.enable = true; + }; + }; } // (import ../dev/dev-scenarios.nix { inherit lib scenarios; }); diff --git a/test/tests.py b/test/tests.py index 1959c7d..b9795dc 100644 --- a/test/tests.py +++ b/test/tests.py @@ -433,6 +433,18 @@ def _(): if enabled("btcpayserver"): machine.wait_until_succeeds(log_has_string("nbxplorer", f"At height: {num_blocks}")) +@test("trustedcoin") +def _(): + machine.wait_for_unit("bitcoind") + machine.wait_for_unit("clightning") + + # Let's check the trustedcoin plugin was correctly initialized + machine.wait_until_succeeds(log_has_string("clightning", "plugin-trustedcoin[^^]\[0m\s+initialized plugin")) + machine.wait_until_succeeds(log_has_string("clightning", "plugin-trustedcoin[^^]\[0m\s+bitcoind RPC working")) + machine.wait_until_succeeds(log_has_string("clightning", "plugin-trustedcoin[^^]\[0m\s+tip: 0")) + machine.wait_until_succeeds(log_has_string("clightning", "plugin-trustedcoin[^^]\[0m\s+estimatefees error: none of the esploras returned usable responses")) + + if "netns-isolation" in enabled_tests: def ip(name): return test_data["netns"][name]["address"]