0a2c8e4864dc30b6d1ed86a16793d37699707650 run-tests: add option --copy-src (Erik Arvstedt) 803584a28889f27ebdc57bf165edff7cec9dfc6b backups: don't use hardcoded secrets dir (Erik Arvstedt) c29d44b49a734b3268cf49811356ff4483fb6ed2 ci: use 'cachix watch-exec' (Erik Arvstedt) 6a32812412ccbd1912b97bae611c6788b2cb77f9 services: add names for systemd helper scripts (Erik Arvstedt) 69826996131d2d9169cffc2eeb019b2f43a42a9c services: use consistent layout (Erik Arvstedt) a43534dda0c52c9d070aa30c4cc60ad3ef6a26d6 services: improve config file setup (Erik Arvstedt) 18f2002cf0a514f5fcbadb77e9318bcca7c49506 joinmarket-yieldgenerator: improve systemd journal output (Erik Arvstedt) 9d0b8c8f6fba676f9ecf61705e569e59ec16b3af joinmarket-ob-watcher: use DynamicUser (Erik Arvstedt) e9c98f415cc164628d7ccdacf066b8decca95afd joinmarket: explain need for tor control socket (Erik Arvstedt) d9c87b6a8f5f2649a8502e494cc2bc34397bd174 joinmarket: fix wallet creation (Erik Arvstedt) 745835010899aac6518a32dceaeace368ed2b327 treewide: remove deprecated types.loaOf (Erik Arvstedt) 9cf038939cc67f57ed11d270a8049483872a719b treewide: use mkEnableOption (Erik Arvstedt) 7a97304f13d2373c685243172b0cd2a10213f745 treewide: remove unit descriptions (Erik Arvstedt) a942177ecf8fe7b28d4218e9fc80bd4c4a4e0341 treewide: remove user descriptions (Erik Arvstedt) 4f6ff408efef3f8550baa0a62a5a0e40570499a1 treewide: remove unneeded string literals (Erik Arvstedt) e6a6c721c1d1e3b8ca85f1765edb9f1fa8df6be5 treewide: streamline 'extraConfig' descriptions (Erik Arvstedt) e774c045de5e6c9934bc1410edd5f2bc9980da17 treewide: fix formatting (Erik Arvstedt) 0b5b29a2a3903122897badfb0b6841eef260a0f1 netns-isolation: simplify permission definition for netns-exec (Erik Arvstedt) a587a2b02a9d611b092d76cfa0f8e225eb48e365 defaultHardening: explain where @system-service is defined (Erik Arvstedt) bb3a69797e96eb06c222ac64cc82ce99e11e9072 README: minor improvements (Erik Arvstedt) 13fc9dfabfd16f164f2dc3124a752d68f79cb9ab examples: improve introductory comments (Erik Arvstedt) af2040f4c46547fa4bfd2e03d0f964c4b656de07 netns-isolation: use 'true' for systemd option (Erik Arvstedt) c246bbb36e700a42e452a3c486b2c3240fee0ef4 bitcoind, clightning, lnd: improve descriptions (Erik Arvstedt) 7533f12ef19733036e93923421859d3a8b055c61 bitcoind, clightning, run-tests: minor refactoring (Erik Arvstedt) 41fe9b0c1dfbee8cc304a0ba923c3dcb2b4c53a0 elementsd: minor refactoring (Erik Arvstedt) f0850d3f2346ae2b7a05e96b8c79a44b5fc8376b btcpayserver: reorder config settings (Erik Arvstedt) d1c0ea9f85d40d28a239f171947de1b9a1cb19ef btcpayserver: add missing systemd postgresql dependency (Erik Arvstedt) Pull request description: ACKs for top commit: jonasnick: ACK 0a2c8e4864dc30b6d1ed86a16793d37699707650 Tree-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.sh
creates 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.sh
creates a QEMU VM.
Requires: Nix -
./deploy-nixops.sh
creates a VirtualBox VM via NixOps.
NixOps can be used to deploy to various other backends like cloud providers.
Requires: Nix, VirtualBox -
./deploy-container-minimal.sh
creates 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.