joelklabo / nostr-control

A CLN Plugin you can interact with over Nostr DM
20 stars 4 forks source link

Use SQL plugin to get alias > node id #2

Closed joelklabo closed 1 year ago

joelklabo commented 1 year ago

lightning-cli sql -o "SELECT nodeid, alias FROM nodes INNER JOIN nodes_addresses ON nodes_addresses.row = nodes.rowid"

joelklabo commented 1 year ago

short channel id -> alias query:

lightning-cli sql -o "SELECT n.alias, pc.short_channel_id FROM nodes n JOIN peerchannels pc ON n.nodeid = pc.peer_id JOIN forwards f ON (pc.short_channel_id = f.in_channel OR pc.short_channel_id = f.out_channel)"