Skip to content

Commit

Permalink
bump nixpkgs and add --developer flag to cln test config (#263)
Browse files Browse the repository at this point in the history
* bump nixpkgs and add --developer flag to cln test config

* remove instances of lightningd-dev

* tests: temporarily disable Test_ClnCln_StuckChannels

* tests: re-enable updated stuck channels test
  • Loading branch information
grubles authored Jan 18, 2024
1 parent 9b5965e commit 6bd3af1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 30 deletions.
30 changes: 9 additions & 21 deletions packages.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
let
# Pinning to revision be28f5521e1d3fec2bd22928f721120725aba272
# - cln v23.08 (with fix for clnrest.py crash on NixOS)
# - lnd v0.16.3-beta
# - bitcoin v25.0
# - elements v22.1.1
# Pinning to revision c8a66e2bb84c2b9cf7014a61c44ffb13ef4317ed
# - cln v23.11
# - lnd v0.17.0-beta
# - bitcoin v25.1
# - elements v23.2.1

rev = "be28f5521e1d3fec2bd22928f721120725aba272";
rev = "c8a66e2bb84c2b9cf7014a61c44ffb13ef4317ed";
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
pkgs = import nixpkgs {};

Expand All @@ -17,27 +17,15 @@ bitcoind = (pkgs.bitcoind.overrideAttrs (attrs: {
};
}));

# Build a clightning version with developer features enabled.
# Clightning is way more responsive with dev features.
clightning-dev = (pkgs.clightning.overrideDerivation (attrs: {
configureFlags = [ "--enable-developer" "--disable-valgrind" ];

pname = "clightning-dev";
postInstall = ''
mv $out/bin/lightningd $out/bin/lightningd-dev
'';
}));

in with pkgs;
{
execs = {
clightning = clightning;
clightning-dev = clightning-dev;
bitcoind = bitcoind;
elementsd = elementsd;
mermaid = nodePackages.mermaid-cli;
lnd = lnd;
};
testpkgs = [ go bitcoind elementsd clightning-dev lnd ];
devpkgs = [ go_1_19 gotools bitcoind elementsd clightning clightning-dev lnd ];
}
testpkgs = [ go bitcoind elementsd lnd ];
devpkgs = [ go_1_19 gotools bitcoind elementsd clightning lnd ];
}
1 change: 0 additions & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ stdenv.mkDerivation rec {
alias bitcoin-cli='${execs.bitcoind}/bin/bitcoin-cli'
alias elementsd='${execs.elementsd}/bin/elementsd'
alias elements-cli='${execs.elementsd}/bin/elements-cli'
alias lightningd-dev='${execs.clightning-dev}/bin/lightningd-dev'
alias lnd='${execs.lnd}/bin/lnd'
alias lncli='${execs.lnd}/bin/lncli'
Expand Down
16 changes: 8 additions & 8 deletions test/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ func clnclnSetupWithConfig(t *testing.T, fundAmt, pushAmt uint64, clnConf []stri
os.ModePerm,
)

// Use lightningd with dev flags enabled
lightningd.WithCmd("lightningd-dev")
// Use lightningd with --developer turned on
lightningd.WithCmd("lightningd")

// Add plugin to cmd line options
lightningd.AppendCmdLine(append([]string{fmt.Sprint("--plugin=", pathToPlugin)}, clnConf...))
Expand Down Expand Up @@ -243,8 +243,8 @@ func mixedSetup(t *testing.T, fundAmt uint64, funder fundingNode) (*testframewor
os.ModePerm,
)

// Use lightningd with dev flags enabled
cln.WithCmd("lightningd-dev")
// Use lightningd with --developer turned on
cln.WithCmd("lightningd")

// Add plugin to cmd line options
cln.AppendCmdLine([]string{
Expand Down Expand Up @@ -405,8 +405,8 @@ func clnclnElementsSetup(t *testing.T, fundAmt uint64) (*testframework.BitcoinNo
os.ModePerm,
)

// Use lightningd with dev flags enabled
lightningd.WithCmd("lightningd-dev")
// Use lightningd with --developer turned on
lightningd.WithCmd("lightningd")

// Add plugin to cmd line options
lightningd.AppendCmdLine([]string{
Expand Down Expand Up @@ -665,8 +665,8 @@ func mixedElementsSetup(t *testing.T, fundAmt uint64, funder fundingNode) (*test
os.ModePerm,
)

// Use lightningd with dev flags enabled
cln.WithCmd("lightningd-dev")
// Use lightningd with --developer turned on
cln.WithCmd("lightningd")

// Add plugin to cmd line options
cln.AppendCmdLine([]string{
Expand Down
2 changes: 2 additions & 0 deletions testframework/clightning.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ func NewCLightningNode(testDir string, bitcoin *BitcoinNode, id int) (*CLightnin
fmt.Sprintf("--bitcoin-rpcpassword=%s", bitcoinRpcPass),
fmt.Sprintf("--bitcoin-rpcport=%s", bitcoinRpcPort),
fmt.Sprintf("--bitcoin-datadir=%s", bitcoin.DataDir),
fmt.Sprintf("--developer"),
fmt.Sprintf("--allow-deprecated-apis=true"),
}

// socketPath := filepath.Join(networkDir, "lightning-rpc")
Expand Down

0 comments on commit 6bd3af1

Please sign in to comment.