LIGHTNING-LISTDATASTORE(7)
π¦ LIGHTNING-LISTDATASTORE(7) π¦
okay so this is the lightning-listdatastore manual page, bestie β it lives in section 7 of the Core Lightning docs and it's literally your cheat sheet for peeking at what plugins have stashed away. let's get into it π
β¨ NAME β¨
listdatastore β the command for listing (plugin) data π
β¨ SYNOPSIS β¨
listdatastore [key]
β¨ DESCRIPTION β¨
the listdatastore RPC command lets plugins fetch data that was stored in the Core Lightning database. that's it, that's the vibe β it's the "hey what's in the store rn" command π«Ά
key(one of, optional) β the thing you're asking about, and it can take a couple of shapes:- (array of strings): all the immediate children of the key (or the root children, if you're being nosy at the top level) get returned. big recommendation from the docs: use the first element of the key as the plugin name, like
[ 'summary' ]β do that, it's the iconic move. it's an array of values that form a hierarchy (though ngl a single value is just treated as a one-element array). - (string, optional)
- (string)
- (array of strings): all the immediate children of the key (or the root children, if you're being nosy at the top level) get returned. big recommendation from the docs: use the first element of the key as the plugin name, like
β¨ RETURN VALUE β¨
on success you get an object containing datastore back. it's an array of objects, and each one of those objects has:
key(array of strings) β the key itself:- (string, optional): a part of the key that was added to the datastore.
generation(u64, optional): how many times this thing has been updated. the glow-up counter, fr fr.hex(hex, optional): the hex data from the datastore.string(string, optional): the data as a string β but only if it's valid utf-8 π
β¨ ERRORS β¨
the following error codes may occur:
-32602: invalid parameters. (you gave it something it can't work with, no cap π)
β¨ AUTHOR β¨
Rusty Russell rusty@rustcorp.com.au is mainly responsible. thank you rusty, king behavior π
β¨ SEE ALSO β¨
lightning-datastore(7), lightning-deldatastore(7), lightning-datastoreusage(7)
β¨ RESOURCES β¨
main web site: https://github.com/ElementsProject/lightning π
β¨ EXAMPLES β¨
Example 1 π
Request:
$ lightning-cli listdatastore -k "key"='["employee"]'
{
"id": "example:listdatastore#1",
"method": "listdatastore",
"params": {
"key": [
"employee"
]
}
}
Response:
{
"datastore": [
{
"key": [
"employee",
"index"
],
"generation": 0,
"hex": "736176696e6720656d706c6f796565206b65797320746f207468652073746f7265",
"string": "saving employee keys to the store"
}
]
}
Example 2 πΈ
Request:
$ lightning-cli listdatastore -k "key"="somekey"
{
"id": "example:listdatastore#2",
"method": "listdatastore",
"params": {
"key": "somekey"
}
}
Response:
{
"datastore": [
{
"key": [
"somekey"
],
"generation": 0,
"hex": "61",
"string": "a"
}
]
}
and that's the whole page, bestie, you ate that π«Ά this little masterpiece is from Core Lightning v26.06.9 β go forth and list some datastore, ily, bye πβ¨π
π¦ where this page comes from
- nixpkgs unstable: clightning 26.06.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms