Skip to content

Latest commit

 

History

History

examples

README.md

Examples

The easiest way to try out bitcoinix is to use one of the provided examples.

Flakes-based quick start

If you use a Flakes-enabled version of Nix, run the following command to start a minimal bitcoinix QEMU VM:

nix run github:bitcoinix/bitcoinix/v<version>

Replace <version> with the latest release tag listed at https://github.com/bitcoinix/bitcoinix/tags.
The VM (defined in flake.nix) runs in the terminal and has Bitcoin Core and Core Lightning installed.
It leaves no traces (outside of /nix/store) on the host system.

More examples

Clone this repo and enter the examples shell:

git clone https://github.com/bitcoinix/bitcoinix
cd bitcoinix/examples/
nix-shell

The following example scripts set up a bitcoinix 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 Bitcoin Core and Core Lightning.

Run the examples with option --interactive or -i to start a shell for interacting with the node:

./deploy-qemu-vm.sh -i

Tests

The bitcoinix test suite is also useful for exploring features.

Deployment examples

  • ./flakes: a node flake with the secure-node preset that you deploy with nixos-rebuild switch --flake .#fullnode --target-host root@<node>.
  • ./colmena: a full node with the secure-node preset, deployed with Colmena.

CI builds both on every pull request and deploys the legacy krops example with ./deploy-krops.sh (see deployment-examples.sh). The installation guide walks through a deployment.

Flakes

Flakes make it easy to include bitcoinix in an existing NixOS config. The flakes example shows how to use bitcoinix as an input to a system flake.

Persistent container with Flakes

The persistent container example shows how to run a Flake-based node in a container.
Requires: A systemd-based Linux distro and root privileges.

Extending bitcoinix with Flakes

The historical mempool extension flake illustrates how to define packages and modules in a flake for the predecessor project. mempool is included in bitcoinix itself; enable it with services.mempool.enable.