BoltzExchange / boltz-backend

Boltz Backend
https://boltz.exchange
GNU Affero General Public License v3.0
115 stars 46 forks source link

How to enable mpay for CLN - python dependencies. #547

Closed urza closed 4 months ago

urza commented 5 months ago

Hi there, I wanted to give mpay a try instead of the default pay plugin for my CLN.

I naively tried to just copy the "mpay" folder from your repo (tools/plugins/mpay) into my .lightning/plugins directory.

However I get this errors about missing dependencies:

lightningd --log-level=DEBUG
2024-05-20T09:05:39.451Z INFO    lightningd: v24.02.2
2024-05-20T09:05:39.515Z DEBUG   plugin-manager: blacklist for bcli
2024-05-20T09:05:39.515Z INFO    plugin-manager: /usr/libexec/c-lightning/plugins/bcli: disabled via disable-plugin
2024-05-20T09:05:39.523Z DEBUG   plugin-manager: started(1627) /usr/libexec/c-lightning/plugins/autoclean
2024-05-20T09:05:39.524Z DEBUG   plugin-manager: started(1628) /usr/libexec/c-lightning/plugins/chanbackup
2024-05-20T09:05:39.525Z DEBUG   plugin-manager: started(1629) /usr/libexec/c-lightning/plugins/commando
2024-05-20T09:05:39.526Z DEBUG   plugin-manager: started(1630) /usr/libexec/c-lightning/plugins/fetchinvoice
2024-05-20T09:05:39.527Z DEBUG   plugin-manager: started(1631) /usr/libexec/c-lightning/plugins/funder
2024-05-20T09:05:39.528Z DEBUG   plugin-manager: started(1632) /usr/libexec/c-lightning/plugins/topology
2024-05-20T09:05:39.529Z DEBUG   plugin-manager: started(1633) /usr/libexec/c-lightning/plugins/keysend
2024-05-20T09:05:39.530Z DEBUG   plugin-manager: started(1634) /usr/libexec/c-lightning/plugins/offers
2024-05-20T09:05:39.531Z DEBUG   plugin-manager: started(1635) /usr/libexec/c-lightning/plugins/pay
2024-05-20T09:05:39.532Z DEBUG   plugin-manager: started(1636) /usr/libexec/c-lightning/plugins/recover
2024-05-20T09:05:39.533Z DEBUG   plugin-manager: started(1637) /usr/libexec/c-lightning/plugins/txprepare
2024-05-20T09:05:39.534Z DEBUG   plugin-manager: started(1638) /usr/libexec/c-lightning/plugins/cln-renepay
2024-05-20T09:05:39.535Z DEBUG   plugin-manager: started(1639) /usr/libexec/c-lightning/plugins/spenderp
2024-05-20T09:05:39.536Z DEBUG   plugin-manager: started(1640) /usr/libexec/c-lightning/plugins/sql
2024-05-20T09:05:39.537Z DEBUG   plugin-manager: started(1641) /usr/libexec/c-lightning/plugins/cln-grpc
2024-05-20T09:05:39.538Z DEBUG   plugin-manager: started(1642) /usr/libexec/c-lightning/plugins/bookkeeper
2024-05-20T09:05:39.539Z DEBUG   plugin-manager: started(1644) /usr/libexec/c-lightning/plugins/clnrest/clnrest.py
2024-05-20T09:05:39.540Z DEBUG   plugin-manager: started(1645) /home/knob/.coffee/bitcoin/plugins/folgore/target/release/folgore_plugin
2024-05-20T09:05:39.541Z DEBUG   plugin-manager: started(1646) /home/knob/.lightning/plugins/mpay/mpay.py
2024-05-20T09:05:39.552Z INFO    plugin-clnrest.py: Killing plugin: disabled itself: No module named 'gevent'
Traceback (most recent call last):
  File "/home/knob/.lightning/plugins/mpay/mpay.py", line 7, in <module>
    from bolt11 import decode as bolt11_decode
ModuleNotFoundError: No module named 'bolt11'
lightningd: FATAL SIGNAL 11 (version v24.02.2)
0x56256638cf9e send_backtrace
        common/daemon.c:33
0x56256638d035 crashdump
        common/daemon.c:75
0x7f2ddf08551f ???
        ???:0
0x56256635e2b0 plugin_conn_finish
        lightningd/plugin.c:876
0x5625664fee49 destroy_conn
        ccan/ccan/io/poll.c:246
0x5625664fee6f destroy_conn_close_fd
        ccan/ccan/io/poll.c:252
0x56256650908f notify
        ccan/ccan/tal/tal.c:246
0x562566509162 del_tree
        ccan/ccan/tal/tal.c:437
0x5625665096c7 tal_free
        ccan/ccan/tal/tal.c:521
0x5625664fd9f2 io_close
        ccan/ccan/io/io.c:450
0x5625664ff487 io_loop
        ccan/ccan/io/poll.c:457
0x562566332d88 io_loop_with_timers
        lightningd/io_loop_with_timers.c:22
0x56256635feba plugins_init
        lightningd/plugin.c:2070
0x562566337db6 main
        lightningd/lightningd.c:1173
0x7f2ddf06cd8f ???
        ???:0
0x7f2ddf06ce3f ???
        ???:0
0x56256630cd64 ???
        ???:0
0xffffffffffffffff ???
        ???:0
Segmentation fault (core dumped)

It looks like the plugin needs "bolt11" dependecy.

Could you perhaps make a short few commands guide for us non-pythoners how to install this properly? :) Managing python dependencies seems a bit confusing between all the pip/poetry/system.. so it would be great to have this from someone who know what they are doing :)

This lead me to look into the poetry.lock and there seems to be a lot of dependencies in poetry.lock file - is it common in python that so many packages are used? Is that all going to be installed for mpay? Maybe I am too paranoid, but that looks like a big surface area for supply chain attack - given that lighting nodes are basically hot wallets..

michael1011 commented 5 months ago

It looks like the plugin needs "bolt11" dependecy.

Yes, it does need it

Could you perhaps make a short few commands guide for us non-pythoners how to install this properly?

In that virtual environment, you can execute the plugin

is it common in python that so many packages are used?

Yes. The lockfile contains transitive dependencies. So, dependencies of dependencies.

Is that all going to be installed for mpay?

No, those poetry files are for multiple plugins. I'll need to clean that up

urza commented 5 months ago

Thanks. When I installed Poetry and run poetry install in tools folder I get this error:

 poetry install
The currently activated Python version 3.8.10 is not supported by the project (>=3.10,<3.13).
Trying to find and use a compatible version.
Using python3.12 (3.12.3)
Creating virtualenv plugins-4zV4T9r8-py3.12 in /home/urza/.cache/pypoetry/virtualenvs
Installing dependencies from lock file

Package operations: 50 installs, 0 updates, 0 removals

  - Installing pycparser (2.22)
  - Installing asn1crypto (1.5.1)
  - Installing bitarray (2.9.2)
  - Installing cffi (1.16.0)
  - Installing base58 (2.1.1)
  - Installing bitstring (4.1.4)
  - Installing certifi (2024.2.2)
  - Installing charset-normalizer (3.3.2)
  - Installing coincurve (18.0.0): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-312
  creating build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/types.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/ecdsa.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/flags.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/keys.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/utils.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/context.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/__init__.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/_windows_libsecp256k1.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/py.typed -> build/lib.linux-x86_64-cpython-312/coincurve
  running build_clib
  /tmp/tmpx4wi6a7i/coincurve-18.0.0/libsecp256k1/autogen.sh: 3: autoreconf: not found
  Traceback (most recent call last):
    File "/home/urza/.local/share/pypoetry/venv/lib/python3.8/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in <module>
      main()
    File "/home/urza/.local/share/pypoetry/venv/lib/python3.8/site-packages/pyproject_hooks/_in_process/_in_process.py", line 357, in main
      json_out["return_val"] = hook(**hook_input["kwargs"])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/urza/.local/share/pypoetry/venv/lib/python3.8/site-packages/pyproject_hooks/_in_process/_in_process.py", line 271, in build_wheel
      return _build_backend().build_wheel(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 410, in build_wheel
      return self._build_with_temp_dir(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 395, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 487, in run_setup
      super().run_setup(setup_script=setup_script)
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 266, in <module>
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 184, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
      dist.run_commands()
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/dist.py", line 968, in run_command
      super().run_command(command)
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "<string>", line 97, in run
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/wheel/bdist_wheel.py", line 368, in run
      self.run_command("build")
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/dist.py", line 968, in run_command
      super().run_command(command)
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/_distutils/command/build.py", line 132, in run
      self.run_command(cmd_name)
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/dist.py", line 968, in run_command
      super().run_command(command)
    File "/tmp/tmpc42dw5nc/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "<string>", line 154, in run
    File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/tmp/tmpx4wi6a7i/coincurve-18.0.0/libsecp256k1/autogen.sh']' returned non-zero exit status 127.

  at ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/chef.py:164 in _prepare
      160│
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│
      163│             if error is not None:
    → 164│                 raise error from None
      165│
      166│             return path
      167│
      168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with coincurve (18.0.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "coincurve (==18.0.0)"'.

  - Installing cryptography (41.0.7)
  - Installing idna (3.7)
  - Installing pysocks (1.7.1)
  - Installing six (1.16.0)
  - Installing urllib3 (2.2.1)
michael1011 commented 5 months ago

You are missing a dependency called autoreconf. It has be installed on your system

urza commented 5 months ago

I installed autoreconf, but now it ends with another error:

 poetry install
The currently activated Python version 3.8.10 is not supported by the project (>=3.10,<3.13).
Trying to find and use a compatible version.
Using python3.12 (3.12.3)
Installing dependencies from lock file

Package operations: 37 installs, 0 updates, 0 removals

  - Installing coincurve (18.0.0): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-312
  creating build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/types.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/ecdsa.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/flags.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/keys.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/utils.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/context.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/__init__.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/_windows_libsecp256k1.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/py.typed -> build/lib.linux-x86_64-cpython-312/coincurve
  running build_clib
  configure.ac:37: installing 'build-aux/ar-lib'
  configure.ac:35: installing 'build-aux/compile'
  configure.ac:24: installing 'build-aux/config.guess'
  configure.ac:24: installing 'build-aux/config.sub'
  configure.ac:30: installing 'build-aux/install-sh'
  configure.ac:30: installing 'build-aux/missing'
  Makefile.am:9: error: Libtool library used but 'LIBTOOL' is undefined
  Makefile.am:9:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
  Makefile.am:9:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
  Makefile.am:9:   If 'LT_INIT' is in 'configure.ac', make sure
  Makefile.am:9:   its definition is in aclocal's search path.
  Makefile.am: installing 'build-aux/depcomp'
  parallel-tests: installing 'build-aux/test-driver'
  autoreconf: automake failed with exit status: 1
  Traceback (most recent call last):
    File "/home/urza/.local/share/pypoetry/venv/lib/python3.8/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in <module>
      main()
    File "/home/urza/.local/share/pypoetry/venv/lib/python3.8/site-packages/pyproject_hooks/_in_process/_in_process.py", line 357, in main
      json_out["return_val"] = hook(**hook_input["kwargs"])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/urza/.local/share/pypoetry/venv/lib/python3.8/site-packages/pyproject_hooks/_in_process/_in_process.py", line 271, in build_wheel
      return _build_backend().build_wheel(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 410, in build_wheel
      return self._build_with_temp_dir(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 395, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 487, in run_setup
      super().run_setup(setup_script=setup_script)
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 266, in <module>
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 184, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
      dist.run_commands()
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/dist.py", line 968, in run_command
      super().run_command(command)
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "<string>", line 97, in run
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/wheel/bdist_wheel.py", line 368, in run
      self.run_command("build")
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/dist.py", line 968, in run_command
      super().run_command(command)
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/_distutils/command/build.py", line 132, in run
      self.run_command(cmd_name)
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/dist.py", line 968, in run_command
      super().run_command(command)
    File "/tmp/tmpyrol1h3w/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "<string>", line 154, in run
    File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/tmp/tmpwsfcu618/coincurve-18.0.0/libsecp256k1/autogen.sh']' returned non-zero exit status 1.

  at ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/chef.py:164 in _prepare
      160│
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│
      163│             if error is not None:
    → 164│                 raise error from None
      165│
      166│             return path
      167│
      168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with coincurve (18.0.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "coincurve (==18.0.0)"'.
michael1011 commented 5 months ago

Now you are missing libtool

urza commented 5 months ago

I installed libtool and now I have yet another error. Why is this happening? Is it because ubuntu 20.04 where this is running is too old? Isn't there some better way how to enable mpay plugin for CLN?

poetry install
The currently activated Python version 3.8.10 is not supported by the project (>=3.10,<3.13).
Trying to find and use a compatible version.
Using python3.12 (3.12.3)
Installing dependencies from lock file

Package operations: 37 installs, 0 updates, 0 removals

  - Installing coincurve (18.0.0): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-312
  creating build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/types.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/ecdsa.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/flags.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/keys.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/utils.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/context.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/__init__.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/_windows_libsecp256k1.py -> build/lib.linux-x86_64-cpython-312/coincurve
  copying coincurve/py.typed -> build/lib.linux-x86_64-cpython-312/coincurve
  running build_clib
  libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
  libtoolize: copying file 'build-aux/ltmain.sh'
  libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'build-aux/m4'.
  libtoolize: copying file 'build-aux/m4/libtool.m4'
  libtoolize: copying file 'build-aux/m4/ltoptions.m4'
  libtoolize: copying file 'build-aux/m4/ltsugar.m4'
  libtoolize: copying file 'build-aux/m4/ltversion.m4'
  libtoolize: copying file 'build-aux/m4/lt~obsolete.m4'
  configure.ac:37: installing 'build-aux/ar-lib'
  configure.ac:35: installing 'build-aux/compile'
  configure.ac:24: installing 'build-aux/config.guess'
  configure.ac:24: installing 'build-aux/config.sub'
  configure.ac:30: installing 'build-aux/install-sh'
  configure.ac:30: installing 'build-aux/missing'
  Makefile.am: installing 'build-aux/depcomp'
  parallel-tests: installing 'build-aux/test-driver'
  configure: WARNING: unrecognized options: --enable-openssl-tests
  checking build system type... x86_64-pc-linux-gnu
  checking host system type... x86_64-pc-linux-gnu
  checking for a BSD-compatible install... /usr/bin/install -c
  checking whether build environment is sane... yes
  checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
  checking for gawk... gawk
  checking whether make sets $(MAKE)... yes
  checking whether make supports nested variables... yes
  checking whether make supports nested variables... (cached) yes
  checking for gcc... gcc
  checking whether the C compiler works... yes
  checking for C compiler default output file name... a.out
  checking for suffix of executables...
  checking whether we are cross compiling... no
  checking for suffix of object files... o
  checking whether we are using the GNU C compiler... yes
  checking whether gcc accepts -g... yes
  checking for gcc option to accept ISO C89... none needed
  checking whether gcc understands -c and -o together... yes
  checking whether make supports the include directive... yes (GNU style)
  checking dependency style of gcc... none
  checking dependency style of gcc... none
  checking for ar... ar
  checking the archiver (ar) interface... ar
  checking how to print strings... printf
  checking for a sed that does not truncate output... /usr/bin/sed
  checking for grep that handles long lines and -e... /usr/bin/grep
  checking for egrep... /usr/bin/grep -E
  checking for fgrep... /usr/bin/grep -F
  checking for ld used by gcc... /usr/bin/ld
  checking if the linker (/usr/bin/ld) is GNU ld... yes
  checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
  checking the name lister (/usr/bin/nm -B) interface... BSD nm
  checking whether ln -s works... yes
  checking the maximum length of command line arguments... 1572864
  checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
  checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
  checking for /usr/bin/ld option to reload object files... -r
  checking for objdump... objdump
  checking how to recognize dependent libraries... pass_all
  checking for dlltool... no
  checking how to associate runtime and link libraries... printf %s\n
  checking for archiver @FILE support... @
  checking for strip... strip
  checking for ranlib... ranlib
  checking command to parse /usr/bin/nm -B output from gcc object... ok
  checking for sysroot... no
  checking for a working dd... /usr/bin/dd
  checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
  checking for mt... mt
  checking if mt is a manifest tool... no
  checking how to run the C preprocessor... gcc -E
  checking for ANSI C header files... yes
  checking for sys/types.h... yes
  checking for sys/stat.h... yes
  checking for stdlib.h... yes
  checking for string.h... yes
  checking for memory.h... yes
  checking for strings.h... yes
  checking for inttypes.h... yes
  checking for stdint.h... yes
  checking for unistd.h... yes
  checking for dlfcn.h... yes
  checking for objdir... .libs
  checking if gcc supports -fno-rtti -fno-exceptions... no
  checking for gcc option to produce PIC... -fPIC -DPIC
  checking if gcc PIC flag -fPIC -DPIC works... yes
  checking if gcc static flag -static works... yes
  checking if gcc supports -c -o file.o... yes
  checking if gcc supports -c -o file.o... (cached) yes
  checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
  checking dynamic linker characteristics... GNU/Linux ld.so
  checking how to hardcode library paths into programs... immediate
  checking whether stripping libraries is possible... yes
  checking if libtool supports shared libraries... yes
  checking whether to build shared libraries... no
  checking whether to build static libraries... yes
  checking if gcc supports -Werror=unknown-warning-option... no
  checking if gcc supports -std=c89 -pedantic -Wno-long-long -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef... yes
  checking if gcc supports -Wno-overlength-strings... yes
  checking if gcc supports -Wall... yes
  checking if gcc supports -Wno-unused-function... yes
  checking if gcc supports -Wextra... yes
  checking if gcc supports -Wcast-align... yes
  checking if gcc supports -Wcast-align=strict... yes
  checking if gcc supports -Wconditional-uninitialized... no
  checking if gcc supports -fvisibility=hidden... yes
  checking for valgrind support...
  checking for x86_64 assembly availability... yes
  configure: ******
  configure: WARNING: experimental build
  configure: Experimental features do not have stable APIs or properties, and may not be safe for production use.
  configure: ******
  checking that generated files are newer than configure... done
  configure: creating ./config.status
  config.status: creating Makefile
  config.status: creating libsecp256k1.pc
  config.status: creating src/libsecp256k1-config.h
  config.status: executing depfiles commands
  config.status: executing libtool commands
  configure: WARNING: unrecognized options: --enable-openssl-tests

  Build Options:
    with external callbacks = no
    with benchmarks         = no
    with tests              = no
    with coverage           = no
    with examples           = no
    module ecdh             = yes
    module recovery         = yes
    module extrakeys        = yes
    module schnorrsig       = yes

    asm                     = x86_64
    ecmult window size      = 15
    ecmult gen prec. bits   = 4

    valgrind                = no
    CC                      = gcc
    CPPFLAGS                =
    SECP_CFLAGS             = -O2  -std=c89 -pedantic -Wno-long-long -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef -Wno-overlength-strings -Wall -Wno-unused-function -Wextra -Wcast-align -Wcast-align=strict -fvisibility=hidden
    CFLAGS                  = -g -O2
    LDFLAGS                 =
  make  all-am
  make[1]: Entering directory '/tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312'
    CC       src/libsecp256k1_la-secp256k1.lo
    CC       src/libsecp256k1_precomputed_la-precomputed_ecmult.lo
    CC       src/libsecp256k1_precomputed_la-precomputed_ecmult_gen.lo
    CCLD     libsecp256k1_precomputed.la
    CCLD     libsecp256k1.la
  make[1]: Leaving directory '/tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312'
  make  install-am
  make[1]: Entering directory '/tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312'
  make[2]: Entering directory '/tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312'
   /usr/bin/mkdir -p '/tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312/lib'
   /bin/bash ./libtool   --mode=install /usr/bin/install -c   libsecp256k1.la '/tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312/lib'
  libtool: install: /usr/bin/install -c .libs/libsecp256k1.lai /tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312/lib/libsecp256k1.la
  libtool: install: /usr/bin/install -c .libs/libsecp256k1.a /tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312/lib/libsecp256k1.a
  libtool: install: chmod 644 /tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312/lib/libsecp256k1.a
  libtool: install: ranlib /tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312/lib/libsecp256k1.a
  libtool: finish: PATH="/tmp/tmpbdrjqmox/.venv/bin:/home/urza/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin" ldconfig -n /tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312/lib
  ----------------------------------------------------------------------
  Libraries have been installed in:
     /tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312/lib

  If you ever happen to want to link against installed libraries
  in a given directory, LIBDIR, you must either use libtool, and
  specify the full pathname of the library, or use the '-LLIBDIR'
  flag during linking and do at least one of the following:
     - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
       during execution
     - add LIBDIR to the 'LD_RUN_PATH' environment variable
       during linking
     - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
     - have your system administrator add LIBDIR to '/etc/ld.so.conf'

  See any operating system documentation about shared libraries for
  more information, such as the ld(1) and ld.so(8) manual pages.
  ----------------------------------------------------------------------
   /usr/bin/mkdir -p '/tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312/include'
   /usr/bin/install -c -m 644 /tmp/tmpa0om8s65/coincurve-18.0.0/libsecp256k1/include/secp256k1.h /tmp/tmpa0om8s65/coincurve-18.0.0/libsecp256k1/include/secp256k1_preallocated.h /tmp/tmpa0om8s65/coincurve-18.0.0/libsecp256k1/include/secp256k1_ecdh.h /tmp/tmpa0om8s65/coincurve-18.0.0/libsecp256k1/include/secp256k1_recovery.h /tmp/tmpa0om8s65/coincurve-18.0.0/libsecp256k1/include/secp256k1_extrakeys.h /tmp/tmpa0om8s65/coincurve-18.0.0/libsecp256k1/include/secp256k1_schnorrsig.h '/tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312/include'
   /usr/bin/mkdir -p '/tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312/lib/pkgconfig'
   /usr/bin/install -c -m 644 libsecp256k1.pc '/tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312/lib/pkgconfig'
  make[2]: Leaving directory '/tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312'
  make[1]: Leaving directory '/tmp/tmpa0om8s65/coincurve-18.0.0/build/temp.linux-x86_64-cpython-312'
  error: [Errno 2] No such file or directory: 'pkg-config'

  at ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/chef.py:164 in _prepare
      160│
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│
      163│             if error is not None:
    → 164│                 raise error from None
      165│
      166│             return path
      167│
      168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with coincurve (18.0.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "coincurve (==18.0.0)"'.
kilrau commented 5 months ago

Did you get this running or still need help @urza ?

urza commented 5 months ago

After I installed pkg-config I was able to finish the poetry-install.

However when I now run lightningd it looks like doesn't know about this at all and is back at the beginning with missin5 bolt11 dependecy.

So I need to figure out how to activate the profile or something whatever it is called that the poetry did..

Could you guys produce a signed binary or something like that that would be possible to just drop into the plugins and work? Or is it not possible with python?

urza commented 5 months ago

Ok, got it: run poetry shell from the same directory as poetry install and start lightningd from there.

But I must say CLN plugins deserve better UX. I can't with clear conscience recommend this to other people like this..

kilrau commented 5 months ago

Definitely agree it's not great UX, just that with python there is only so much you can do about it unfortunately. Since we can't afford a re-write in e.g. Rust right now, we are pushing for CLN's default pay plugin to be fixed. Who manages to get mpay running -great- it's a good bandaid, everyone else has to wait for the default plugins to be fixed.