From b36867c84556f2f310c019f3479e8069319921e1 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Wed, 22 Jan 2025 20:31:30 +0100 Subject: [PATCH 1/2] examples/container: use faster `destroy` cmd This skips evaluating the container system derivation. --- examples/container/usage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/container/usage.sh b/examples/container/usage.sh index 404c386..5b6deb4 100644 --- a/examples/container/usage.sh +++ b/examples/container/usage.sh @@ -39,7 +39,7 @@ extra-container start mynode # You can also use the `create --start` command above # Destroy container -nix run . -- destroy +extra-container destroy mynode #――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # Inspect container config From b8f6343ee4b924273bba11877e208e2ad4dd3adb Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Wed, 22 Jan 2025 20:41:52 +0100 Subject: [PATCH 2/2] fix test `persistentContainerExample` This test requires `electrs` to be enabled. Also, by using `electrs` instead of `clightning` we avoid the bug where clightning hangs at startup when internet access is unavailable. Due to technical limititations, internet access is available in NixOS containers only after the container has started. --- examples/container/flake.nix | 2 +- examples/container/usage.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/container/flake.nix b/examples/container/flake.nix index c4f64a8..d51d04c 100644 --- a/examples/container/flake.nix +++ b/examples/container/flake.nix @@ -61,7 +61,7 @@ # Enable some services. # See ../configuration.nix for all available features. services.bitcoind.enable = true; - services.clightning.enable = true; + services.electrs.enable = true; }; }; }; diff --git a/examples/container/usage.sh b/examples/container/usage.sh index 5b6deb4..cc724ff 100644 --- a/examples/container/usage.sh +++ b/examples/container/usage.sh @@ -21,8 +21,8 @@ nix run . -- create --start # Run command in container extra-container run mynode -- hostname extra-container run mynode -- systemctl status bitcoind -extra-container run mynode -- lightning-cli getinfo -extra-container run mynode -- bash -c 'bitcoin-cli -getinfo && lightning-cli getinfo' +extra-container run mynode -- bitcoin-cli -getinfo +extra-container run mynode -- bash -c 'bitcoin-cli -getinfo && systemctl status electrs' # Start shell in container extra-container root-login mynode