HTMX GetInfo Widget
Alright, so we've done all this work! We started by parsing each QR code to get the Rune and service endpoints. Then we used that information to interact with our nodes using lightning-cli-rest. Next, we used the reckless-wrapper
RPC calls to instruct reckless to download and enable the cln-htmx-getinfo
plugin to our node.
Great! It's now primed and ready to accept HTMX calls.
In any case, let's see the HTMX:
<!-- include HTMX -->
<script src="https://unpkg.com/htmx.org@1.9.10" integrity="sha384-D1Kt99CQMDuVetoL1lrYwg5t+9QdHe7NLX/SoJYkXDFfX37iInKRy5xLSi8nO7UC" crossorigin="anonymous"></script>
<button hx-post="https://lnplay.rocketcitybitcoin.org:9001/v1/htmx-getinfo"
hx-headers='{"Rune": "zM6DCJhUyUuKoFk5ef6sbycFtU3UzP8AgZhUGVFPq909Mw=="}'
hx-target="#response">
Get Info.
</button>
<div id="response"></div>
Here's what that looks like on the page:
💡
Note! This button is not working at the moment as there is no active backend to connect to!
‼️
NOTE! There is an issue with the server-side response headers being set to
application/json
. I think that's why the quotes are there. Needs to be fixed server-side. TODOWas this website helpful for understanding Core Lightning plugin and widget development?
Developing your first CLN Plugin