Files
palladum-lightning/doc/developers-guide/developers-guide.md
Joseph Goulden 1ead6791fd chore: nix flake update
Switched to nixpkgs-unstable
Replaced postgresql dependency with much smaller libpq.
Utilise new inputs.self.submodules feature to simplify flake use
Moved apps to a separate file
Changelog-None
2025-11-13 15:35:51 +10:30

1.7 KiB

title, slug, content, privacy
title slug content privacy
Setting up a dev environment developers-guide
excerpt
Get up and running in your local environment with essential tools and libraries in your preferred programming language.
view
public

Using startup_regtest.sh

The Core Lightning project provides a script startup_regtest.sh to simulate the Lightning Network in your local dev environment. The script starts up some local nodes with bitcoind, all running on regtest and makes it easier to test things out, by hand.

Navigate to contrib in your Core Lightning directory:

cd contrib

Load the script, using source so it can set aliases:

source startup_regtest.sh

Start up the nodeset:

start_ln 3

Connects all nodes with channels, in a row, and funds them:

fund_nodes

When you're finished, stop:

stop_ln

Clean up the lightning directories:

 destroy_ln

Using Polar

Polar offers a one-click setup of Lightning Network for local app development & testing.

Using Nix

Install Nix

Update git submodules git submodule update --init --recursive.

The entry point is flake.nix in the root of the project, where the inputs and outputs are defined.

nix develop will create the default shell env with the build and runtime dependencies of the cln package. Then you can call make manually and the project will compile as usual.

nix develop .#rust will create a shell env for developing rust.

nix build will build the default package (cln).

nix flake check will build the cln and rust packages. Rust tests are run during the build. There are also checks to run cargo audit and nixfmt.