Replies: 1 comment 2 replies
-
Super helpful guide. I've been exploring a bit how to get the first chunk of the directions up and running in Polar (https://lightningpolar.com/), to make it a bit easier to set up a testing environment. If anyone finds this useful... Feel free to use the following zip in Polar to auto-set up a bitcoind backend with some blocks mined and two CLN nodes: onion-message-testing.polar.zip In Polar just click "import network" and drag the above zip file inside, and start the network. (This feature is like my favorite thing ever as of... today) Couldn't get the custom version of lnd node that we need for this project running in Polar for some reason, but maybe I'll do some debugging and add that in later. For now for the lnd node -- hook up the lnd node you run above to the bitcoind |
Beta Was this translation helpful? Give feedback.
-
Testing LNDK locally for development requires a fair amount of setup. This discussion outlines possilbe ways of testing new features locally, with a specific focus on onion messaging related features. Ths guide assumes that you have
bitcoind
running in regtest mode and have setup LND and LND as described in README.1. Setup CLN Nodes
Run two CLN nodes (see Getting Started guide) in developer mode (
./configure --enable-developer
). The bare minimum command set you can work with is:Note:
--dev-fast-gossip
and--experimental-offers
are important.You can create the following aliases for convenience:
alias cl="./cli/lightning-cli --network=regtest --lightning-dir=~/.lightning"
alias cl1="./cli/lightning-cli --network=regtest --lightning-dir=~/.lightning1"
2. Open public channels between
CL -- LND
andCL1 -- LND
, for each CL node:cl getinfo
-> provides pubkey inid
and host/port inaddress
lncli openchannel --node_key={id} --connect=locahost:{port} --local_amt=20000
Remember to mine 6 blocks to confirm channel!
To verify that the channels are open:
cl listincoming
lncli listchannels
3. Fetch an offer invoice to test Onion Messaging
cl offer 100 test
->bolt12
:lno...
cl1 fetchinvoice lno....
This should send an onion message from
CL1 --> LND --> CL
to fetch the invoice, then a return onion message fromCL --> LND --> CL1
to return it.You should be able to see logs in
LNDK
indicating that a message has been forwarded, and LND will logCustom message received peer={peer} type=513
andSending <unknown>(type=513) to {peer}
.Beta Was this translation helpful? Give feedback.
All reactions