LIGHTNING-LISTDATASTORE(7)

πŸ“¦
version 26.06.9 Β· 2 versions
, in nixpkgs unstable

πŸ¦‹ 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)

✨ 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