From 83499c6485e035e63394e34bbf7840fea6abe5e9 Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Sun, 31 Aug 2025 19:47:16 +0530 Subject: [PATCH 1/3] chore: remove __init__.py for package extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit for python 3.3+ we don’t need an __init__.py at namespace package to allow extensions instead we can just get rid of them --- contrib/pyln-client/pyln/__init__.py | 2 -- contrib/pyln-grpc-proto/pyln/__init__.py | 2 -- contrib/pyln-proto/pyln/__init__.py | 2 -- contrib/pyln-spec/bolt1/pyln/__init__.py | 2 -- contrib/pyln-spec/bolt1/pyln/spec/__init__.py | 2 -- contrib/pyln-spec/bolt2/pyln/__init__.py | 2 -- contrib/pyln-spec/bolt2/pyln/spec/__init__.py | 2 -- contrib/pyln-spec/bolt4/pyln/__init__.py | 2 -- contrib/pyln-spec/bolt4/pyln/spec/__init__.py | 2 -- contrib/pyln-spec/bolt7/pyln/__init__.py | 2 -- contrib/pyln-spec/bolt7/pyln/spec/__init__.py | 2 -- contrib/pyln-testing/pyln/__init__.py | 2 -- 12 files changed, 24 deletions(-) delete mode 100644 contrib/pyln-client/pyln/__init__.py delete mode 100644 contrib/pyln-grpc-proto/pyln/__init__.py delete mode 100644 contrib/pyln-proto/pyln/__init__.py delete mode 100644 contrib/pyln-spec/bolt1/pyln/__init__.py delete mode 100644 contrib/pyln-spec/bolt1/pyln/spec/__init__.py delete mode 100644 contrib/pyln-spec/bolt2/pyln/__init__.py delete mode 100644 contrib/pyln-spec/bolt2/pyln/spec/__init__.py delete mode 100644 contrib/pyln-spec/bolt4/pyln/__init__.py delete mode 100644 contrib/pyln-spec/bolt4/pyln/spec/__init__.py delete mode 100644 contrib/pyln-spec/bolt7/pyln/__init__.py delete mode 100644 contrib/pyln-spec/bolt7/pyln/spec/__init__.py delete mode 100644 contrib/pyln-testing/pyln/__init__.py diff --git a/contrib/pyln-client/pyln/__init__.py b/contrib/pyln-client/pyln/__init__.py deleted file mode 100644 index 3c2b6535d778..000000000000 --- a/contrib/pyln-client/pyln/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# pyln is a namespace package -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/contrib/pyln-grpc-proto/pyln/__init__.py b/contrib/pyln-grpc-proto/pyln/__init__.py deleted file mode 100644 index 3c2b6535d778..000000000000 --- a/contrib/pyln-grpc-proto/pyln/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# pyln is a namespace package -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/contrib/pyln-proto/pyln/__init__.py b/contrib/pyln-proto/pyln/__init__.py deleted file mode 100644 index 3c2b6535d778..000000000000 --- a/contrib/pyln-proto/pyln/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# pyln is a namespace package -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/contrib/pyln-spec/bolt1/pyln/__init__.py b/contrib/pyln-spec/bolt1/pyln/__init__.py deleted file mode 100644 index 3c2b6535d778..000000000000 --- a/contrib/pyln-spec/bolt1/pyln/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# pyln is a namespace package -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/contrib/pyln-spec/bolt1/pyln/spec/__init__.py b/contrib/pyln-spec/bolt1/pyln/spec/__init__.py deleted file mode 100644 index 709a95e45275..000000000000 --- a/contrib/pyln-spec/bolt1/pyln/spec/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# spec is a namespace package -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/contrib/pyln-spec/bolt2/pyln/__init__.py b/contrib/pyln-spec/bolt2/pyln/__init__.py deleted file mode 100644 index 3c2b6535d778..000000000000 --- a/contrib/pyln-spec/bolt2/pyln/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# pyln is a namespace package -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/contrib/pyln-spec/bolt2/pyln/spec/__init__.py b/contrib/pyln-spec/bolt2/pyln/spec/__init__.py deleted file mode 100644 index 709a95e45275..000000000000 --- a/contrib/pyln-spec/bolt2/pyln/spec/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# spec is a namespace package -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/contrib/pyln-spec/bolt4/pyln/__init__.py b/contrib/pyln-spec/bolt4/pyln/__init__.py deleted file mode 100644 index 3c2b6535d778..000000000000 --- a/contrib/pyln-spec/bolt4/pyln/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# pyln is a namespace package -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/contrib/pyln-spec/bolt4/pyln/spec/__init__.py b/contrib/pyln-spec/bolt4/pyln/spec/__init__.py deleted file mode 100644 index 709a95e45275..000000000000 --- a/contrib/pyln-spec/bolt4/pyln/spec/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# spec is a namespace package -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/contrib/pyln-spec/bolt7/pyln/__init__.py b/contrib/pyln-spec/bolt7/pyln/__init__.py deleted file mode 100644 index 3c2b6535d778..000000000000 --- a/contrib/pyln-spec/bolt7/pyln/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# pyln is a namespace package -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/contrib/pyln-spec/bolt7/pyln/spec/__init__.py b/contrib/pyln-spec/bolt7/pyln/spec/__init__.py deleted file mode 100644 index 709a95e45275..000000000000 --- a/contrib/pyln-spec/bolt7/pyln/spec/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# spec is a namespace package -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/contrib/pyln-testing/pyln/__init__.py b/contrib/pyln-testing/pyln/__init__.py deleted file mode 100644 index 3c2b6535d778..000000000000 --- a/contrib/pyln-testing/pyln/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# pyln is a namespace package -__path__ = __import__('pkgutil').extend_path(__path__, __name__) From 2d2a1c6c29db06b781ecbd925c3d437cdca20110 Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Sun, 31 Aug 2025 19:49:20 +0530 Subject: [PATCH 2/3] chore: remove uv sources defined at workspace level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit duplicate definition isn’t required as we already defined them at workspace level sources --- contrib/pyln-client/pyproject.toml | 4 ---- contrib/pyln-spec/bolt1/pyproject.toml | 3 --- contrib/pyln-spec/bolt2/pyproject.toml | 3 --- contrib/pyln-spec/bolt4/pyproject.toml | 3 --- contrib/pyln-spec/bolt7/pyproject.toml | 3 --- contrib/pyln-testing/pyproject.toml | 4 ---- 6 files changed, 20 deletions(-) diff --git a/contrib/pyln-client/pyproject.toml b/contrib/pyln-client/pyproject.toml index 9c857f0b6aa9..1639ff3c96ae 100644 --- a/contrib/pyln-client/pyproject.toml +++ b/contrib/pyln-client/pyproject.toml @@ -17,7 +17,3 @@ packages = ["pyln"] [build-system] requires = ["hatchling>=1.0.0"] build-backend = "hatchling.build" - -[tool.uv.sources] -pyln-proto = { workspace = true } -pyln-bolt7 = { workspace = true } diff --git a/contrib/pyln-spec/bolt1/pyproject.toml b/contrib/pyln-spec/bolt1/pyproject.toml index b91c31ba0592..0254d62fea84 100644 --- a/contrib/pyln-spec/bolt1/pyproject.toml +++ b/contrib/pyln-spec/bolt1/pyproject.toml @@ -20,6 +20,3 @@ packages = ["pyln"] [build-system] requires = ["hatchling>=1.0.0"] build-backend = "hatchling.build" - -[tool.uv.sources] -pyln-proto = { workspace = true } diff --git a/contrib/pyln-spec/bolt2/pyproject.toml b/contrib/pyln-spec/bolt2/pyproject.toml index 49b31f638880..5a7c6de7aa03 100644 --- a/contrib/pyln-spec/bolt2/pyproject.toml +++ b/contrib/pyln-spec/bolt2/pyproject.toml @@ -20,6 +20,3 @@ packages = ["pyln"] [build-system] requires = ["hatchling>=1.0.0"] build-backend = "hatchling.build" - -[tool.uv.sources] -pyln-proto = { workspace = true } diff --git a/contrib/pyln-spec/bolt4/pyproject.toml b/contrib/pyln-spec/bolt4/pyproject.toml index 8e91ee175db0..a9409fc59772 100644 --- a/contrib/pyln-spec/bolt4/pyproject.toml +++ b/contrib/pyln-spec/bolt4/pyproject.toml @@ -20,6 +20,3 @@ packages = ["pyln"] [build-system] requires = ["hatchling>=1.0.0"] build-backend = "hatchling.build" - -[tool.uv.sources] -pyln-proto = { workspace = true } diff --git a/contrib/pyln-spec/bolt7/pyproject.toml b/contrib/pyln-spec/bolt7/pyproject.toml index c2e02d5de0c6..655d4031c7ac 100644 --- a/contrib/pyln-spec/bolt7/pyproject.toml +++ b/contrib/pyln-spec/bolt7/pyproject.toml @@ -16,6 +16,3 @@ packages = ["pyln"] [build-system] requires = ["hatchling>=1.0.0"] build-backend = "hatchling.build" - -[tool.uv.sources] -pyln-proto = { workspace = true } diff --git a/contrib/pyln-testing/pyproject.toml b/contrib/pyln-testing/pyproject.toml index 7b543bb855f5..d402d8a33a44 100644 --- a/contrib/pyln-testing/pyproject.toml +++ b/contrib/pyln-testing/pyproject.toml @@ -31,7 +31,3 @@ packages = ["pyln"] [build-system] requires = ["hatchling>=1.0.0"] build-backend = "hatchling.build" - -[tool.uv.sources] -pyln-client = { workspace = true } -pyln-grpc-proto = { workspace = true } From 3e0f23bc92e96eb0407649305d3920a49b5df689 Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Mon, 8 Sep 2025 08:32:03 +0530 Subject: [PATCH 3/3] docs: add frozen for uv sync prevent updates to lock file which might leave working directory dirty resulting in a modded cln version build --- .../getting-started/installation.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/doc/getting-started/getting-started/installation.md b/doc/getting-started/getting-started/installation.md index c9ea97573a77..045bfbc0d3e6 100644 --- a/doc/getting-started/getting-started/installation.md +++ b/doc/getting-started/getting-started/installation.md @@ -29,7 +29,7 @@ If you're on a different distribution or OS, you can compile the source by follo # Docker -To install the Docker image for the latest stable release: +To install the Docker image for the latest stable release: ```shell docker pull elementsproject/lightningd:latest @@ -129,8 +129,8 @@ If you want to build the Rust plugins (cln-grpc, clnrest, cln-bip353 and wss-pro sudo apt-get install -y cargo rustfmt protobuf-compiler ``` -> πŸ“˜ -> +> πŸ“˜ +> > If your build fails because of your Rust version, you might want to check out [rustup](https://rustup.rs/) to install a newer version @@ -139,20 +139,20 @@ There are two ways to build core lightning, and this depends on how you want use To build CLN for production: ```shell -uv sync --all-extras --all-groups +uv sync --all-extras --all-groups --frozen ./configure RUST_PROFILE=release uv run make sudo RUST_PROFILE=release make install ``` -> πŸ“˜ -> +> πŸ“˜ +> > If you want to disable Rust because you don’t need it or its plugins (cln-grpc, clnrest, cln-bip353 or wss-proxy), you can use `./configure --disable-rust`. To build CLN for development: ```shell -uv sync --all-extras --all-groups +uv sync --all-extras --all-groups --frozen ./configure uv run make uv run make check VALGRIND=0 @@ -262,15 +262,15 @@ If you want to compile locally and fiddle with compile time options: See `/usr/ports/net-p2p/c-lightning/Makefile` for instructions on how to build from an arbitrary git commit, instead of the latest release tag. -> πŸ“˜ -> +> πŸ“˜ +> > Make sure you've set an utf-8 locale, e.g. `export LC_CTYPE=en_US.UTF-8`, otherwise manpage installation may fail. Running lightning: Configure bitcoind, if not already: add `rpcuser=` and `rpcpassword=` to `/usr/local/etc/bitcoin.conf`, maybe also `testnet=1`. -Configure lightningd: copy `/usr/local/etc/lightningd-bitcoin.conf.sample` to +Configure lightningd: copy `/usr/local/etc/lightningd-bitcoin.conf.sample` to `/usr/local/etc/lightningd-bitcoin.conf` and edit according to your needs. ```shell @@ -385,15 +385,15 @@ git checkout v24.05 Build lightning: ```shell -uv sync --all-extras --all-groups +uv sync --all-extras --all-groups --frozen ./configure uv run make ``` Running lightning: -> πŸ“˜ -> +> πŸ“˜ +> > Edit your `~/Library/Application\ Support/Bitcoin/bitcoin.conf`to include `rpcuser=` and `rpcpassword=` first, you may also need to include `testnet=1`. ```shell @@ -446,7 +446,7 @@ Launch Core Lightning: ## To cross-compile for Android -Make a standalone toolchain as per . +Make a standalone toolchain as per . For Core Lightning you must target an API level of 24 or higher. Depending on your toolchain location and target arch, source env variables such as: @@ -471,8 +471,8 @@ make clean -C ccan/ccan/cdump/tools \ && make CC=clang -C ccan/ccan/cdump/tools ``` -Install the `qemu-user` package. -This will allow you to properly configure the build for the target device environment. +Install the `qemu-user` package. +This will allow you to properly configure the build for the target device environment. Build with: ```shell @@ -499,8 +499,8 @@ export LD=$target_host-ld export STRIP=$target_host-strip ``` -Install the `qemu-user` package. This will allow you to properly configure the -build for the target device environment. +Install the `qemu-user` package. This will allow you to properly configure the +build for the target device environment. Config the arm elf interpreter prefix: ```shell @@ -544,7 +544,7 @@ For all the other Pi devices out there, consider using [Armbian](https://www.arm You can compile in `customize-image.sh` using the instructions for Ubuntu. -A working example that compiles both bitcoind and Core Lightning for Armbian can +A working example that compiles both bitcoind and Core Lightning for Armbian can be found [here](https://github.com/Sjors/armbian-bitcoin-core). ## To compile for Alpine @@ -588,6 +588,6 @@ apk add libgcc libsodium sqlite-libs zlib ## Python plugins -Python plugins will be installed with the `poetry install` step mentioned above fron development setup. +Python plugins will be installed with the `poetry install` step mentioned above fron development setup. Other users will need some Python packages if python plugins are used. Unfortunately there are some Python packages which are not packaged in Ubuntu, and so force installation will be needed (Flag `--user` is recommended which will install them in user's own .local directory, so at least the risk of breaking Python globally can be avoided!).