LIGHTNING-DELDATASTORE(7)
π 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)
- (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.
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 modemust-replaceormust-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
- 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