Merge fort-nix/nix-bitcoin#445: clightning-plugins: add commando plugin

ee4cdb0586 pyln-proto: relax pycparser constraint (William Casarin)
2d6c4e829e readme: fix monitor c-lightning plugin link (William Casarin)
0bede274a8 clightning-plugins/commando: add module (Erik Arvstedt)
380ec3bb78 clightning-plugins: add commando (William Casarin)
80312ba9d7 python-packages/sha256: init at 0.1 (William Casarin)
71eccb73d6 python-packages/runes: init at 0.4.0 (William Casarin)
570e271695 clightning-plugins: bump to latest git (William Casarin)

Pull request description:

ACKs for top commit:
  erikarvstedt:
    ACK ee4cdb0586

Tree-SHA512: 2db97ee758f061ce72f8e049299c453cc4e9947d9af55c68745aa15bcd9529cb47defb52366ca216249441fb8e113c3b3b048a5381f41fd1ef80e677dae0fe37
This commit is contained in:
Jonas Nick 2022-02-27 18:38:09 +00:00
commit 2618af74e4
No known key found for this signature in database
GPG Key ID: 4861DBF262123605
9 changed files with 110 additions and 3 deletions

View File

@ -66,8 +66,9 @@ NixOS modules ([src](modules/modules.nix))
* [clightning](https://github.com/ElementsProject/lightning) with support for announcing an onion service\ * [clightning](https://github.com/ElementsProject/lightning) with support for announcing an onion service\
Available plugins: Available plugins:
* [clboss](https://github.com/ZmnSCPxj/clboss): automated C-Lightning Node Manager * [clboss](https://github.com/ZmnSCPxj/clboss): automated C-Lightning Node Manager
* [commando](https://github.com/lightningd/plugins/tree/master/commando): control your node over lightning
* [helpme](https://github.com/lightningd/plugins/tree/master/helpme): walks you through setting up a fresh c-lightning node * [helpme](https://github.com/lightningd/plugins/tree/master/helpme): walks you through setting up a fresh c-lightning node
* [monitor](https://github.com/renepickhardt/plugins/tree/master/monitor): helps you analyze the health of your peers and channels * [monitor](https://github.com/lightningd/plugins/tree/master/monitor): helps you analyze the health of your peers and channels
* [prometheus](https://github.com/lightningd/plugins/tree/master/prometheus): lightning node exporter for the prometheus timeseries server * [prometheus](https://github.com/lightningd/plugins/tree/master/prometheus): lightning node exporter for the prometheus timeseries server
* [rebalance](https://github.com/lightningd/plugins/tree/master/rebalance): keeps your channels balanced * [rebalance](https://github.com/lightningd/plugins/tree/master/rebalance): keeps your channels balanced
* [summary](https://github.com/lightningd/plugins/tree/master/summary): print a nice summary of the node status * [summary](https://github.com/lightningd/plugins/tree/master/summary): print a nice summary of the node status

View File

@ -0,0 +1,37 @@
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.services.clightning.plugins.commando; in
{
options.services.clightning.plugins.commando = {
enable = mkEnableOption "commando (clightning plugin)";
readers = mkOption {
type = with types; listOf str;
default = [];
example = [ "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518" ];
description = ''
IDs of nodes which can execute read-only commands (list*, get*, ...).
'';
};
writers = mkOption {
type = with types; listOf str;
default = [];
example = [ "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518" ];
description = ''
IDs of nodes which can execute any commands.
'';
};
};
config = mkIf cfg.enable {
services.clightning.extraConfig = ''
plugin=${config.nix-bitcoin.pkgs.clightning-plugins.commando.path}
''
+ concatMapStrings (reader: ''
commando_reader=${reader}
'') cfg.readers
+ concatMapStrings (writer: ''
commando_writer=${writer}
'') cfg.writers;
};
}

View File

@ -13,6 +13,7 @@ let
in { in {
imports = [ imports = [
./clboss.nix ./clboss.nix
./commando.nix
./prometheus.nix ./prometheus.nix
./summary.nix ./summary.nix
./zmq.nix ./zmq.nix

View File

@ -6,8 +6,8 @@ let
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "lightningd"; owner = "lightningd";
repo = "plugins"; repo = "plugins";
rev = "1f6f701bf1e60882b8fa61cb735e7033c8c29e3c"; rev = "b88c9278102ea9bffddce8143d31e939b31e835c";
sha256 = "088h0yxs0fbrr7r6mi4xmznf0a294i45fbc792xrmwchlay0k7jj"; sha256 = "sha256-qf4MYqP2Bwlqqn2y2LCIYuFq71r2m6IFT/w4noW6ePU=";
}; };
version = builtins.substring 0 7 src.rev; version = builtins.substring 0 7 src.rev;
@ -23,6 +23,10 @@ let
+ " --replace pyln-client~=0.9.3 pyln-client~=0.10.1"; + " --replace pyln-client~=0.9.3 pyln-client~=0.10.1";
}; };
rebalance = { description = "Keeps your channels balanced"; }; rebalance = { description = "Keeps your channels balanced"; };
commando = {
description = "Enable RPC over lightning";
extraPkgs = [ nbPython3Packages.runes ];
};
summary = { summary = {
description = "Prints a summary of the node status"; description = "Prints a summary of the node status";
extraPkgs = [ packaging requests ]; extraPkgs = [ packaging requests ];

View File

@ -11,6 +11,8 @@ in {
urldecode = callPackage ./urldecode {}; urldecode = callPackage ./urldecode {};
chromalog = callPackage ./chromalog {}; chromalog = callPackage ./chromalog {};
txzmq = callPackage ./txzmq {}; txzmq = callPackage ./txzmq {};
sha256 = callPackage ./sha256 {};
runes = callPackage ./runes {};
joinmarketbase = joinmarketPkg ./jmbase; joinmarketbase = joinmarketPkg ./jmbase;
joinmarketclient = joinmarketPkg ./jmclient; joinmarketclient = joinmarketPkg ./jmclient;

View File

@ -4,6 +4,7 @@
, coincurve , coincurve
, base58 , base58
, mypy , mypy
, pycparser
, setuptools-scm , setuptools-scm
}: }:
@ -17,6 +18,7 @@ buildPythonPackage rec {
bitstring bitstring
cryptography cryptography
coincurve coincurve
pycparser
base58 base58
mypy mypy
setuptools-scm setuptools-scm
@ -27,6 +29,7 @@ buildPythonPackage rec {
postUnpack = "sourceRoot=$sourceRoot/contrib/pyln-proto"; postUnpack = "sourceRoot=$sourceRoot/contrib/pyln-proto";
postPatch = '' postPatch = ''
sed -i ' sed -i '
s|pycparser==2.20|pycparser~=2.20|
s|coincurve ~= 13.0|coincurve == 15.0.0| s|coincurve ~= 13.0|coincurve == 15.0.0|
s|base58 ~= 2.0.1|base58 == 2.1.0| s|base58 ~= 2.0.1|base58 == 2.1.0|
s|mypy==0.790|mypy == 0.812| s|mypy==0.790|mypy == 0.812|

View File

@ -0,0 +1,22 @@
{ sha256, lib, buildPythonPackage, fetchFromGitHub }:
buildPythonPackage {
pname = "runes";
version = "0.4.0";
src = fetchFromGitHub {
repo = "runes";
owner = "rustyrussell";
rev = "7e3d7648db844ce2c78cc3e9e4f872f827252251";
sha256 = "sha256-e0iGLV/57gCpqA7vrW6JMFM0R6iAq5oFwUpZoGySwfs=";
};
propagatedBuildInputs = [ sha256 ];
meta = with lib; {
description = "Runes for authentication (like macaroons only simpler)";
homepage = "https://github.com/rustyrussell/runes";
maintainers = with maintainers; [ jb55 ];
license = licenses.mit;
};
}

View File

@ -0,0 +1,32 @@
{ lib, buildPythonPackage, fetchFromGitHub, cython }:
buildPythonPackage rec {
pname = "sha256";
version = builtins.substring 0 8 src.rev;
# The version from pypi is old/broken
src = fetchFromGitHub {
repo = "sha256";
owner = "cloudtools";
rev = "e0645d118f7296dde45397a755261f78d421bdee";
sha256 = "sha256-gEctMgF5qZiWelVHVCl3zazRNuaQ7lJP8ExI5xWEBVI=";
};
nativeBuildInputs = [ cython ];
doCheck = false;
configurePhase = ''
python setup.py sdist
'';
meta = with lib; {
description = ''
SHA-256 implementation that allows for setting and getting the mid-state
information.
'';
homepage = "https://github.com/cloudtools/sha256";
maintainers = with maintainers; [ jb55 ];
license = licenses.mit;
};
}

View File

@ -132,6 +132,11 @@ let
prometheus.enable = true; prometheus.enable = true;
rebalance.enable = true; rebalance.enable = true;
summary.enable = true; summary.enable = true;
commando = {
enable = true;
readers = [ "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518" ];
writers = [ "0336efaa22b8ba77ae721a25d589e1c5f2486073dd2f041add32a23316150e8b62" ];
};
zmq = let tcpEndpoint = "tcp://127.0.0.1:5501"; in { zmq = let tcpEndpoint = "tcp://127.0.0.1:5501"; in {
enable = true; enable = true;
channel-opened = tcpEndpoint; channel-opened = tcpEndpoint;