fort-nix / nix-bitcoin

A collection of Nix packages and NixOS modules for easily installing full-featured Bitcoin nodes with an emphasis on security.
https://nixbitcoin.org
MIT License
513 stars 107 forks source link

Support Bitcoin Knots as alternative to Bitcoin Core? #664

Closed kristapsk closed 11 months ago

kristapsk commented 11 months ago

So that people have choice.

erikarvstedt commented 11 months ago

Here's how to use Knots instead of Core:

Edit: I've added more ways to use knots.

Option 1: Use knots from stable nixpkgs:

services.bitcoind.package = pkgs.bitcoind-knots;

Option 2: Use knots from nixpkgs-unstable. Use this if the knots version of option 1 (stable nixpkgs) is outdated.

services.bitcoind.package = config.nix-bitcoin.pkgs.pinned.pkgsUnstable.bitcoind-knots;

You can find out the knots versions from nix-bitcoin's stable/unstable nixpkgs like so:

# stable nixpkgs
nix eval --inputs-from github:fort-nix/nix-bitcoin/release nixpkgs#bitcoind-knots.version

# unstable nixpkgs
nix eval --inputs-from github:fort-nix/nix-bitcoin/release nixpkgs-unstable#bitcoind-knots.version

Option 3: Use knots from a custom version of nixpkgs-unstable. Use this if the knots version of option 2 is outdated.

services.bitcoind.package = let
  pkgsUnstable = import (builtins.fetchTarball {
    # nixpkgs-unstable as of 2023-12-12
    url = "https://github.com/NixOS/nixpkgs/archive/666fc80e7b2afb570462423cb0e1cf1a3a34fedd.tar.gz";
    sha256 = "1j4ahdm49pbw5s1sw0vc0l12s1zxlnw0sjvnljxhdjbsvgbjsl7m";
  }) {};
in
  pkgsUnstable.bitcoind-knots;