banlist: simplify script, remove package

We're now directly using Greg's unmodified banlist which
simplifies the update process.

The banlist package with its dependency on the bitcoin datadir path is only
relevant for internal use within nix-bitcoin, so we can safely remove
it.

We're now using the bitcoin-cli from `services.bitcoind.package`.

Fixes #129
This commit is contained in:
Erik Arvstedt 2019-11-12 19:40:31 +01:00
parent 55e73f32e3
commit 39885d37c1
No known key found for this signature in database
GPG key ID: 33312B944DD97846
6 changed files with 5609 additions and 762 deletions

View file

@ -264,6 +264,9 @@ in {
else nix-bitcoin-services.allowAnyIP)
// optionalAttrs (cfg.zmqpubrawblock != null || cfg.zmqpubrawtx != null) nix-bitcoin-services.allowAnyProtocol;
};
# Use this to update the banlist:
# wget https://people.xiph.org/~greg/banlist.cli.txt
systemd.services.bitcoind-import-banlist = {
description = "Bitcoin daemon banlist importer";
requires = [ "bitcoind.service" ];
@ -289,11 +292,16 @@ in {
sleep 1
done
'';
serviceConfig = {
Type = "simple";
User = "${cfg.user}";
Group = "${cfg.group}";
ExecStart = "${pkgs.bash}/bin/bash ${pkgs.banlist}/bin/banlist ${pkgs.blockchains.bitcoind}";
script = ''
echo "Importing node banlist..."
cd ${cfg.cli}/bin
. ${./banlist.cli.txt}
'';
# Permission for preStart
PermissionsStartOnly = "true";