LIGHTNING-DELDATASTORE(7)

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

πŸ’… lightning-deldatastore(7) β€” the deldataSTORE page, bestie

okay so picture this: you're a plugin, you've been storing little treats in the Core Lightning database, and now you wanna ✨clean up✨. That's this page. deldatastore lives in section 7 of the Core Lightning manual, and it's about to be your new fave.


πŸ¦‹ NAME

deldatastore β€” the command for removing (plugin) data. yes, delete. goodbye. it's giving closure. πŸ’–


🌸 SYNOPSIS

deldatastore key [generation]

✨ DESCRIPTION

So basically the deldatastore RPC command is the thing that lets plugins delete data they've stored in the Core Lightning database. spring cleaning but make it RPC. 🧹

Heads up though: the command fails if the key isn't there, or if you specified generation and the generation of the data doesn't exactly match. no partial matches, no "close enough", none of that. 😭

  • key (one of):
    • (array of strings) β€” the key is an array of values (though a single value gets treated as a one-element array, cute), and that's how you form a heirarchy. using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended, iykyk. a key can either have children or a value, never both β€” parents are created and removed automatically, so you don't gotta do anything. 🫢
    • (string, optional)
    • (string)
  • generation (u64, optional) β€” if you specify it, that means the update will fail if the previously-existing data isn't exactly that generation. this is how you get simple atomicity. also it's only legal with mode must-replace or must-append. πŸ’€

πŸ‘‘ RETURN VALUE

On success you get an object back, containing:

  • key (array of strings):
    • (string, optional) β€” part of the key added to the datastore.
  • generation (u64, optional) β€” how many times this has been updated. the origin story count. πŸ”₯
  • hex (hex, optional) β€” the hex data which has removed from the datastore.
  • string (string, optional) β€” the data as a string, if it's valid utf-8. πŸŽ€

🚨 ERRORS

The following error codes may occur, bestie, so be ready:

  • 1200 β€” the key does not exist πŸ™ˆ
  • 1201 β€” the key does exist, but the generation is wrong 😭
  • -32602 β€” invalid parameters πŸ’€

🌈 AUTHOR

Rusty Russell rusty@rustcorp.com.au is mainly responsible. main character energy fr fr. πŸ‘‘


πŸ¦‹ SEE ALSO

lightning-listdatastore(7), lightning-datastore(7), lightning-datastoreusage(7) β€” read these next, they're all connected, no cap.


🌐 RESOURCES

Main web site: https://github.com/ElementsProject/lightning β€” go be nosy. πŸ’œ


πŸ“ EXAMPLES

Example 1:

Request:

$ lightning-cli deldatastore -k "key"='["test", "name"]'
{
  "id": "example:deldatastore#1",
  "method": "deldatastore",
  "params": {
    "key": [
      "test",
      "name"
    ]
  }
}

Response:

{
  "key": [
    "test",
    "name"
  ],
  "generation": 0,
  "hex": "736176696e67206461746120746f207468652073746f7265",
  "string": "saving data to the store"
}

Example 2:

Request:

$ lightning-cli deldatastore -k "key"="otherkey" "generation"=1
{
  "id": "example:deldatastore#2",
  "method": "deldatastore",
  "params": {
    "key": "otherkey",
    "generation": 1
  }
}

Response:

{
  "key": [
    "otherkey"
  ],
  "generation": 1,
  "hex": "6f74686572206b65793a207465787420746f20626520617070656e64656420746f20746865206f746865726b6579",
  "string": "other key: text to be appended to the otherkey"
}

this lil masterpiece is from Core Lightning v26.06.9, and yeah it's the LIGHTNING-DELDATASTORE(7) page β€” go delete some data bestie, slay πŸ’…βœ¨πŸ’–

πŸ“¦ where this page comes from