Pages
  • LNROOM newsletter
  • First live coding session [#1]
  • pyln-client and Python decorators [#2]
  • Write tests for CLN plugins and Unix domain sockets [#3]
  • pyln-client implementation and Torq node management software [#4]
  • CLN Hooks and BOLT11 [#5]
  • nostr-control and scaling-lightning [#6]
  • bcli and Securing a $100M Lightning node [#7]
  • LDK Node, Greenlight and Breez SDK [#8]
  • Remote control and L402 [#9]
  • LN summit in NY, splicing and Mutiny [#10]
  • commando, lnsocket and CLN 23.08 rc1 [#11]
  • CLN v23.08, sovereign stack and BOLT #12 [#12]
  • Vincenzo Palazzo, LSPs & renepay plugin [#13]
  • Testing applications & 4 major LN implementations [#14]
  • LSP, VLS and Bitcoin Education [#15]
  • LN limitations, Timeout Trees, Greenlight and River report [#16]
  • 1 year of lnroom.live [#17]
  • BOLT#11, clangd and renepay [#18]
  • BOLT#11, Rusty Russell, Clams and CLN v23.11 [#19]
  • Bech32, Chaincode Labs, Christian Decker and Severin Bühler [#20]
  • PeerSwap, Breez SDK and Mutiny Wallet FAQ [#21]
LNROOM newsletter
  • LNROOM newsletter
  • First live coding session [#1]
  • pyln-client and Python decorators [#2]
  • Write tests for CLN plugins and Unix domain sockets [#3]
  • pyln-client implementation and Torq node management software [#4]
  • CLN Hooks and BOLT11 [#5]
  • nostr-control and scaling-lightning [#6]
  • bcli and Securing a $100M Lightning node [#7]
  • LDK Node, Greenlight and Breez SDK [#8]
  • Remote control and L402 [#9]
  • LN summit in NY, splicing and Mutiny [#10]
  • commando, lnsocket and CLN 23.08 rc1 [#11]
  • CLN v23.08, sovereign stack and BOLT #12 [#12]
  • Vincenzo Palazzo, LSPs & renepay plugin [#13]
  • Testing applications & 4 major LN implementations [#14]
  • LSP, VLS and Bitcoin Education [#15]
  • LN limitations, Timeout Trees, Greenlight and River report [#16]
  • 1 year of lnroom.live [#17]
  • BOLT#11, clangd and renepay [#18]
  • BOLT#11, Rusty Russell, Clams and CLN v23.11 [#19]
  • Bech32, Chaincode Labs, Christian Decker and Severin Bühler [#20]
  • PeerSwap, Breez SDK and Mutiny Wallet FAQ [#21]

BOLT#11, clangd and renepay

#18・November 16, 2023

In the live coding session of next week (Thursday) we are going to look at the implementation of BOLT #11 invoices in Core Lightning source code.

I think we are going to have some fun. If you are interested soon you'll find more information about the event at:

https://community.corelightning.org/c/events/

Last Tuesday I set up my text editor to work with the CLN code base written in C. Specifically I wanted code completion and jump-to-definition functionalities. To have them I used clangd language server. Let me describe the step I followed in case you want to use it in your editor/IDE.

First, I installed clang and clangd by running the following command (I'm on Ubuntu 22.04.2 LTS):

$ sudo apt install clang-15 clangd-15
$ sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 100
$ sudo update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-15 100

Then I set the LSP (language server protocol) client of my editor (eglot in my case on Emacs). In the install page of clangd there are instructions for other editors.

To help clangd understand CLN source code, I generated the file compile_commands.json at the top of CLN repository which contains compile commands for every source file in a project.

To do so I used bear utility after running ./configure script like this:

$ ./configure CC=clang --disable-rust
$ make clean
$ bear -- make

BOOM! Ready to hack on Core Lightning!

Links:

  • https://twitter.com/tonyaldon/status/1724478753005248588

  • https://clang.llvm.org

  • https://clangd.llvm.org

  • https://clangd.llvm.org/installation

  • https://github.com/rizsotto/Bear

In CLN 23.08, the renepay plugin has been added. It adds renepay command which implements Rene's minimum cost flow proposals in a concrete form.

Eduardo Quintana who implemented this plugin wrote 2 articles about it that you may find interesting:

  • Renepay I: Linearization of the Cost Function,

  • Renepay II Combining Fees and Uncertainty Cost (part 1).

This plugin is still experimental.

Rene Pickardt and Stefan Richter are currently reviewing renepay plugin on Github. I think there will be some interesting conversations there! Here are the corresponding issues where the conversation with Eduardo Quintana has already started:

  • https://github.com/ElementsProject/lightning/issues/6846

  • https://github.com/ElementsProject/lightning/issues/6852

Maybe you also want to check the pickhardtpayments repository which implements collection of classes and interfaces that help with testing and implementation of Pickhardt Payments:

https://github.com/renepickhardt/pickhardtpayments

That's it for today, I hope you're doing well, See you next time, Tony Aldon https://lnroom.live

PREVRANDOMNEXT