0a2c8e4864run-tests: add option --copy-src (Erik Arvstedt)803584a288backups: don't use hardcoded secrets dir (Erik Arvstedt)c29d44b49aci: use 'cachix watch-exec' (Erik Arvstedt)6a32812412services: add names for systemd helper scripts (Erik Arvstedt)6982699613services: use consistent layout (Erik Arvstedt)a43534dda0services: improve config file setup (Erik Arvstedt)18f2002cf0joinmarket-yieldgenerator: improve systemd journal output (Erik Arvstedt)9d0b8c8f6fjoinmarket-ob-watcher: use DynamicUser (Erik Arvstedt)e9c98f415cjoinmarket: explain need for tor control socket (Erik Arvstedt)d9c87b6a8fjoinmarket: fix wallet creation (Erik Arvstedt)7458350108treewide: remove deprecated types.loaOf (Erik Arvstedt)9cf038939ctreewide: use mkEnableOption (Erik Arvstedt)7a97304f13treewide: remove unit descriptions (Erik Arvstedt)a942177ecftreewide: remove user descriptions (Erik Arvstedt)4f6ff408eftreewide: remove unneeded string literals (Erik Arvstedt)e6a6c721c1treewide: streamline 'extraConfig' descriptions (Erik Arvstedt)e774c045detreewide: fix formatting (Erik Arvstedt)0b5b29a2a3netns-isolation: simplify permission definition for netns-exec (Erik Arvstedt)a587a2b02adefaultHardening: explain where @system-service is defined (Erik Arvstedt)bb3a69797eREADME: minor improvements (Erik Arvstedt)13fc9dfabfexamples: improve introductory comments (Erik Arvstedt)af2040f4c4netns-isolation: use 'true' for systemd option (Erik Arvstedt)c246bbb36ebitcoind, clightning, lnd: improve descriptions (Erik Arvstedt)7533f12ef1bitcoind, clightning, run-tests: minor refactoring (Erik Arvstedt)41fe9b0c1delementsd: minor refactoring (Erik Arvstedt)f0850d3f23btcpayserver: reorder config settings (Erik Arvstedt)d1c0ea9f85btcpayserver: add missing systemd postgresql dependency (Erik Arvstedt) Pull request description: ACKs for top commit: jonasnick: ACK0a2c8e4864Tree-SHA512: 5c81b36042fbb2f016c8e58ba9e05ef3389d5376b8df713d3258d2cd0b6a9239904531171aca8e49bea7039341d5fa91aa9474c6d98de849c25ede52deccc5a3
Examples
The easiest way to try out nix-bitcoin is to use one of the provided examples.
git clone https://github.com/fort-nix/nix-bitcoin
cd nix-bitcoin/examples/
nix-shell
The following example scripts set up a nix-bitcoin node according to configuration.nix and then
shut down immediately. They leave no traces (outside of /nix/store) on the host system.
By default, configuration.nix enables bitcoind and clightning.
-
./deploy-container.shcreates a NixOS container.
This is the fastest way to set up a node.
Requires: Nix, a systemd-based Linux distro and root privileges -
./deploy-qemu-vm.shcreates a QEMU VM.
Requires: Nix -
./deploy-nixops.shcreates a VirtualBox VM via NixOps.
NixOps can be used to deploy to various other backends like cloud providers.
Requires: Nix, VirtualBox -
./deploy-container-minimal.shcreates a container defined by minimal-configuration.nix that doesn't use the secure-node.nix preset. Also shows how to use nix-bitcoin in an existing NixOS config.
Requires: Nix, a systemd-based Linux distro and root privileges
Run the examples with option --interactive or -i to start a shell for interacting with
the node:
./deploy-qemu-vm.sh -i
Tests
The internal test suite is also useful for exploring features.
The following run-tests.sh commands leave no traces (outside of /nix/store) on
the host system.
git clone https://github.com/fort-nix/nix-bitcoin
cd nix-bitcoin/test
# Run a Python test shell inside a VM node
./run-tests.sh debug
print(succeed("systemctl status bitcoind"))
# Run a node in a container. Requires systemd and root privileges.
./run-tests.sh container
c systemctl status bitcoind
# Explore a single feature
./run-tests.sh --scenario electrs container
# Run a command in a container
./run-tests.sh --scenario '{
services.clightning.enable = true;
nix-bitcoin.nodeinfo.enable = true;
}' container --run c nodeinfo
See run-tests.sh for a complete documentation.