Merge fort-nix/nix-bitcoin#568: Minor improvements

0de16095e1 clightning-replication: switch system before waiting for server sshd (Erik Arvstedt)
d332177d3e clightning: extract var `bitcoind` (Erik Arvstedt)
1b5e51b7fe examples/vm-config: fix syntax error (Erik Arvstedt)
565deb770a examples/minimal-vm: add `lightning-cli` demo command (Erik Arvstedt)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK 0de16095e1

Tree-SHA512: cafcc7a51152b480d26a55c926b21a01ef7565c948cf28926017565c1ef180e7500494eefb4b114ab371d4d0a62f9efd2ebf3722877d1c62f890827cd7b34574
This commit is contained in:
Jonas Nick 2022-11-10 12:55:40 +00:00
commit 4a533d90ea
No known key found for this signature in database
GPG Key ID: 4861DBF262123605
4 changed files with 10 additions and 7 deletions

View File

@ -43,6 +43,7 @@ rec {
- nodeinfo - nodeinfo
- systemctl status bitcoind - systemctl status bitcoind
- systemctl status clightning - systemctl status clightning
- lightning-cli getinfo
''; '';
# Power off VM when the user exits the shell # Power off VM when the user exits the shell

View File

@ -3,7 +3,7 @@
# Disable the hardened preset to improve VM performance # Disable the hardened preset to improve VM performance
disabledModules = [ <nix-bitcoin/modules/presets/hardened.nix> ]; disabledModules = [ <nix-bitcoin/modules/presets/hardened.nix> ];
imports = [ (modulesPath + "/virtualisation/qemu-vm.nix" ]; imports = [ (modulesPath + "/virtualisation/qemu-vm.nix") ];
config = { config = {
virtualisation.graphics = false; virtualisation.graphics = false;

View File

@ -102,16 +102,18 @@ let
nbLib = config.nix-bitcoin.lib; nbLib = config.nix-bitcoin.lib;
nbPkgs = config.nix-bitcoin.pkgs; nbPkgs = config.nix-bitcoin.pkgs;
network = config.services.bitcoind.makeNetworkName "bitcoin" "regtest"; inherit (config.services) bitcoind;
network = bitcoind.makeNetworkName "bitcoin" "regtest";
configFile = pkgs.writeText "config" '' configFile = pkgs.writeText "config" ''
network=${network} network=${network}
bitcoin-datadir=${config.services.bitcoind.dataDir} bitcoin-datadir=${bitcoind.dataDir}
${optionalString (cfg.proxy != null) "proxy=${cfg.proxy}"} ${optionalString (cfg.proxy != null) "proxy=${cfg.proxy}"}
always-use-proxy=${boolToString cfg.always-use-proxy} always-use-proxy=${boolToString cfg.always-use-proxy}
bind-addr=${cfg.address}:${toString cfg.port} bind-addr=${cfg.address}:${toString cfg.port}
bitcoin-rpcconnect=${nbLib.address config.services.bitcoind.rpc.address} bitcoin-rpcconnect=${nbLib.address bitcoind.rpc.address}
bitcoin-rpcport=${toString config.services.bitcoind.rpc.port} bitcoin-rpcport=${toString bitcoind.rpc.port}
bitcoin-rpcuser=${config.services.bitcoind.rpc.users.public.name} bitcoin-rpcuser=${bitcoind.rpc.users.public.name}
rpc-file-mode=0660 rpc-file-mode=0660
log-timestamps=false log-timestamps=false
${optionalString (cfg.wallet != null) "wallet=${cfg.wallet}"} ${optionalString (cfg.wallet != null) "wallet=${cfg.wallet}"}

View File

@ -128,8 +128,8 @@ makeTestVM {
# A gocryptfs has been created # A gocryptfs has been created
client.succeed("ls /var/backup/clightning/lightningd-db/gocryptfs.conf") client.succeed("ls /var/backup/clightning/lightningd-db/gocryptfs.conf")
server.wait_for_unit("sshd.service")
switch_to_system("replicationRemote") switch_to_system("replicationRemote")
server.wait_for_unit("sshd.service")
with subtest("remote replication"): with subtest("remote replication"):
replica_db = "/var/cache/clightning-replication/sshfs/lightningd.sqlite3" replica_db = "/var/cache/clightning-replication/sshfs/lightningd.sqlite3"
client.succeed(f"runuser -u clightning -- ls {replica_db}") client.succeed(f"runuser -u clightning -- ls {replica_db}")