diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e383a47 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "warnet"] + path = warnet + url = https://github.com/bitcoin-dev-project/warnet.git +[submodule "sim-ln"] + path = sim-ln + url = https://github.com/bitcoin-dev-project/sim-ln.git diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..b50ceec --- /dev/null +++ b/flake.lock @@ -0,0 +1,163 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "goflake": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1680659771, + "narHash": "sha256-5Gli0PdnZh2rUQTDapyz0pDG+yzRq5AAPoMpZkdMaGQ=", + "owner": "sagikazarmark", + "repo": "go-flake", + "rev": "1a32d77792361575b617f7e52f107273ef4ba723", + "type": "github" + }, + "original": { + "owner": "sagikazarmark", + "repo": "go-flake", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1666539104, + "narHash": "sha256-jeuC+d375wHHxMOFLgu7etseCQVJuPNKoEc9X9CsErg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0e6df35f39651504249a05191f9a78d251707e22", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1713537308, + "narHash": "sha256-XtTSSIB2DA6tOv+l0FhvfDMiyCmhoRbNB+0SeInZkbk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5c24cf2f0a12ad855f444c30b2421d044120c66f", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1706487304, + "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "90f456026d284c22b3e3497be980b2e47d0b28ac", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "goflake": "goflake", + "nixpkgs": "nixpkgs_2", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1713492869, + "narHash": "sha256-Zv+ZQq3X+EH6oogkXaJ8dGN8t1v26kPZgC5bki04GnM=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "1e9264d1214d3db00c795b41f75d55b5e153758e", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f37d2ba --- /dev/null +++ b/flake.nix @@ -0,0 +1,76 @@ +{ + description = "A simple core lightning plugin that simplifies the Splice operation"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + goflake.url = "github:sagikazarmark/go-flake"; + rust-overlay.url = "github:oxalica/rust-overlay"; + }; + + outputs = { self, nixpkgs, flake-utils, goflake, rust-overlay, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ rust-overlay.overlay ]; + }; + + lnd-src = pkgs.fetchFromGitHub { + owner = "carlaKC"; # Replace with the GitHub username + repo = "lnd"; + rev = "attackathon"; # Replace with the specific branch you want to build + sha256 = "sha256-0OuTRdulX22qWmbgN7EQ8c9m+kqzdRwffxIxhvyAGak="; # Replace with the correct sha256 + }; + + in + { + packages = { + default = pkgs.gnumake; + }; + formatter = pkgs.nixpkgs-fmt; + + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + # build dependencies + libcap + gcc + pkg-config + git + jq + + gnumake + golangci-lint + just + + go + rustc + cargo + python3 + + docker + docker-machine-kvm2 + kubernetes + minikube + dnsmasq + + libvirt + qemu_kvm + virt-manager + + # integration test dependencies + lnd-src + bitcoind + ]; + + shellHook = '' + export LIBVIRT_DEFAULT_URI='qemu:///system' + export CGO_ENABLED=0 + export HOST_CC=gcc + export PWD=$(pwd) + export RUST_LOG=info + ''; + }; + } + ); +} diff --git a/sim-ln b/sim-ln new file mode 160000 index 0000000..dc544fa --- /dev/null +++ b/sim-ln @@ -0,0 +1 @@ +Subproject commit dc544fa9d3cdc1d0b7247b06172b0503f3f02dc7 diff --git a/warnet b/warnet new file mode 160000 index 0000000..49ececa --- /dev/null +++ b/warnet @@ -0,0 +1 @@ +Subproject commit 49ececad5952464617677e9b2079c9d4fd4be8a0