Skip to content

Instantly share code, notes, and snippets.

@gabridome
gabridome / c-lightning_snippets.md
Last active September 17, 2020 05:57
Snippets for c-lightning

Simple commands to extract informations from c-lightning

To see the list of lightning transactions you have to aggregate the result of two commands:

export invoices=$(lightning-cli listinvoices|jq '[.invoices[]|select( .status == "paid" )|{"payment_hash":.payment_hash, "time":.paid_at|gmtime|todate, "amount":.msatoshi,"fees":0, "description":.description}]')
export sendpays=$(lightning-cli listsendpays|jq '[.payments[]|select(.status == "complete")|{"payment_hash":.payment_hash,"time":.created_at|gmtime|todate,"amount":(.msatoshi_sent * -1),"fees":(.msatoshi_sent - .msatoshi), "description":"payment"}]')

and then you can join the two results and sort them by "time":

jq --argjson invoices "$invoices" --argjson sendpays "$sendpays" -n '$invoices + $sendpays | sort_by(.time)'
@gabridome
gabridome / c-lightning_on_tor.md
Last active July 21, 2020 03:36
c-lightning on TOR a straightforward way to be visible on tor

C-LIGHTNING connected from inside your firewall in 60 lines

C-lightning is pretty rich in terms of options on how to be visible and/or how to reach other nodes in the lightning network.

The purpose of this article is to put you in the condition to be reached on the Tor network in the most straightforward way I am aware of, leaving more complex and reach configurations to deeper studies. You can find the documentation [here][tordoc].