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]

pyln-client implementation and Torq node management software

#4・May 04, 2023

The Python package pyln-client lets you write CLN plugins and also implements a RPC client to lightningd daemon. If you'd like to understand how it is implemented you can watch:

  • Overview of pyln-client implementation - Plugin.run() - Part 1,

  • Overview of pyln-client implementation - @plugin.method() - Part 2 and

  • Overview of pyln-client implementation - LightningRpc - Part 3.

When I was working on LNROOM #13 video about LightningRpc class in the package pyln-client, I learned that on linux OSs the socket path must be shorter than the in-kernel buffer size.

For instance, we can create a unix socket /tmp/foo.sock listening for incomming connection like this:

$ nc -lU /tmp/foo.sock

but with a file name too long, trying to run the following (on my machine Ubuntu 22.04.02 LTS)

$ nc -lU /tmp/a-very-long-path-a-very-long-path-a-very-long-path-a-very-long-path-a-very-long-path-a-very-long-path-a-very-long-path

we get the following error:

nc: File name too long

The class LightningRpc of pyln-client takes care of that case in an interesting way. If you are interested, here is the link to the source code:

https://github.com/ElementsProject/lightning/blob/v23.02.2/contrib/pyln-client/pyln/client/lightning.py#L221

If you are running (or are planning to run) big lightning nodes with thousands of channels, maybe you'll need at some point a tool like Torq developed by https://torq.co.

Torq is an advanced node management software that helps lightning node operators analyze and automate their nodes. It is designed to handle large nodes with over 1000 channels.

If you want to know more about it, you can watch the interview of Henrik Skogstrøm, founder and CEO of Torq, in Stephan Livera's podcast: Challenges of Operating Lightning Nodes & Torq with Henrik Skogstrøm (SLP474).

Have an amazing day, Tony Aldon https://lnroom.live

PREVRANDOMNEXT