Skip to content

Commit

Permalink
multi: using nix flake and upgrading lwk
Browse files Browse the repository at this point in the history
The version of lwk has been raised to cli_0.5.1.
Change to use flake to use cli_0.5.1 in nix as well.
Using flake allows you to run nix develop instead of nix-shell.

Just uses the flake on nix shell.
For the nix-env addon users.
  • Loading branch information
YusukeShimizu committed Jul 1, 2024
1 parent 22f4e66 commit 45fb414
Show file tree
Hide file tree
Showing 9 changed files with 301 additions and 115 deletions.
31 changes: 7 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,13 @@ jobs:
strategy:
matrix:
test-vector: [bitcoin-cln, bitcoin-lnd, liquid-cln, liquid-lnd, misc-integration, lwk-cln, lwk-lnd]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: "Cache Nix store"
uses: actions/cache@v3.0.8
id: nix-cache
with:
path: /tmp/nixcache
key: nix-${{ hashFiles('packages.nix') }}

- name: Install Nix
uses: cachix/install-nix-action@v20
uses: actions/checkout@v4
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: "Import Nix store cache"
if: "steps.nix-cache.outputs.cache-hit == 'true'"
run: "nix-store --import < /tmp/nixcache"

- name: Run tests
run: nix-shell --run "make test-${{matrix.test-vector}}"

- name: "Export Nix store cache"
if: "steps.nix-cache.outputs.cache-hit != 'true'"
run: "nix-store --export $(find /nix/store -maxdepth 1 -name '*-*') > /tmp/nixcache"
fetch-depth: 0
- name: Install Nix and run tests
uses: determinateSystems/nix-installer-action@v12
- uses: DeterminateSystems/magic-nix-cache-action@v7
- uses: DeterminateSystems/flake-checker-action@v8
- run: nix-shell --run "make test-${{matrix.test-vector}}"
5 changes: 0 additions & 5 deletions ci.nix

This file was deleted.

2 changes: 1 addition & 1 deletion docs/setup_lwk.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**[Liquid Wallet Kit](https://github.com/Blockstream/lwk/tree/master)** is a collection of Rust crates for [Liquid](https://liquid.net) Wallets and is used for PeerSwap L-BTC swaps.
To set up `lwk` for PeerSwap, follow the steps here.
lwk is currently under development and changes are being made.
**peerswap has been tested only with [cli_0.3.0](https://github.com/Blockstream/lwk/tree/cli_0.3.0)**.
**peerswap has been tested only with [cli_0.5.1](https://github.com/Blockstream/lwk/releases/tag/cli_0.5.1)**.

## wallet
peerswap assumes a wallet with blinding-key set in singlesig to lwk.
Expand Down
216 changes: 216 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
inputs = {
# Pinning to revision f54322490f509985fa8be4ac9304f368bd8ab924
# - cln v24.02.1
# - lnd v0.17.4-beta
# - bitcoin v26.0
# - elements v23.2.1
nixpkgs.url = "github:NixOS/nixpkgs/f54322490f509985fa8be4ac9304f368bd8ab924";
flake-utils.url = "github:numtide/flake-utils";
# blockstream-electrs: init at 0.4.1 #299761
# https://github.com/NixOS/nixpkgs/pull/299761/commits/680d27ad847801af781e0a99e4b87ed73965c69a
nixpkgs2.url = "github:NixOS/nixpkgs/680d27ad847801af781e0a99e4b87ed73965c69a";
# lwk: init at wasm_0.6.3 #14bac28
# https://github.com/Blockstream/lwk/releases/tag/wasm_0.6.3
lwk-flake = {
url = "github:blockstream/lwk/14bac284fe712dd6fdbbbe82bda179a2a236b2fa";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
outputs = { self, nixpkgs, nixpkgs2, flake-utils, lwk-flake }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
system = system;
};
pkgs2 = import nixpkgs2 {
system = system;
};
blockstream-electrs = pkgs2.blockstream-electrs.overrideAttrs (oldAttrs: {
cargoBuildFlags = [ "--features liquid" "--bin electrs" ];
});
bitcoind = pkgs.bitcoind.overrideAttrs (attrs: {
meta = attrs.meta or { } // { priority = 0; };
});
lwk = lwk-flake.packages.${system}.bin;
in
with pkgs;
{
devShells.default = mkShell {
buildInputs = [
go_1_22
gotools
blockstream-electrs
bitcoind
elementsd
clightning
lnd
lwk
];
# Cannot run the debugger without this
# see https://github.com/go-delve/delve/issues/3085
hardeningDisable = [ "all" ];
};
}
);
}
Loading

0 comments on commit 45fb414

Please sign in to comment.