You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to automate integration testing using nix-bitcoin. Our project opens lightning channels, so I'd like to run bitcoind and a cluster of 2 LND nodes. I believe using nix lets us control the environment such that we could even onboard devs in a repl.it link like @Kodylowdid at btc++.
Because some teammates run mac, and some linux, it seems like the NixOS VM isn't ready for this solution yet. If I understand correctly we could run such a NixOS VM in a docker container to solve this problem for now. We've got to use docker to support Umbrel and btcpayserver plugins, anyhow. Building that container from Nix also seems like the best way to a reproducible, maintainable build.
So far I've written a flake to 1. nix-build the binary 2. nix-develop in a defaultShell that includes tools to build that binary and 3. Spit out a docker container that includes the build.
I'm lost on how to get bitcoind, and then LND instances running in that container. Does it make to write logic that runs them in the flake? What do you make of the docker approach? If the approach makes sense, how does one define a running bitcoind and lightning cluster from a flake?
I figure others will want to do this in the future so an issue here could help.
The text was updated successfully, but these errors were encountered:
So, we are not using any flake, but we are using nix-bitcoin or better the nix-pkgs bitcoinelementsdclightning and some helper packages for our dev environment on https://github.com/ElementsProject/peerswap.
We use the nix-shell command to spawn a shell that has the dependencies set and a helper shell script to spawn a network with several nodes. This is currently in a bad shape as we mix it also with some docker containers for the local playground, but the integration tests use the packages from the nix-shell environment.
Maybe take a look at the repo and especially at the following files:
packages.nix
shell.nix
testframework/... for usage in the bitcoin and lightning proxies
.github/ci.yaml for caching in github ci
.contrib/startup_regtest.sh this is in a bad shape and uses a docker compose setup but could be changed to use the binaries provided by the nix-shell
Hope this is a helpful starting point.
By the way: mac is also possible if the nix-pkgs are usable on mac, I added mac compatibility to the clightning nix package some time ago for example.
Maybe we could write a walk-trough/tutorial some time.
@nepet This is the way to go. Thank you for your thorough response.
re: .contrrib/startup_regtest.sh using the binaries provided by nix-shell, is there any way to use the declarative nix modules/configuration setup to avoid shell scripting the startup? I'm a bit confused between how things run in NixOS vm vs in binaries the shell has access to
I'd like to automate integration testing using nix-bitcoin. Our project opens lightning channels, so I'd like to run bitcoind and a cluster of 2 LND nodes. I believe using nix lets us control the environment such that we could even onboard devs in a repl.it link like @Kodylow did at btc++.
Because some teammates run mac, and some linux, it seems like the NixOS VM isn't ready for this solution yet. If I understand correctly we could run such a NixOS VM in a docker container to solve this problem for now. We've got to use docker to support Umbrel and btcpayserver plugins, anyhow. Building that container from Nix also seems like the best way to a reproducible, maintainable build.
So far I've written a flake to 1.
nix-build
the binary 2.nix-develop
in a defaultShell that includes tools to build that binary and 3. Spit out a docker container that includes the build.I'm lost on how to get bitcoind, and then LND instances running in that container. Does it make to write logic that runs them in the flake? What do you make of the docker approach? If the approach makes sense, how does one define a running bitcoind and lightning cluster from a flake?
I figure others will want to do this in the future so an issue here could help.
The text was updated successfully, but these errors were encountered: