LIGHTNING-DATASTOREUSAGE(7)
π LIGHTNING-DATASTOREUSAGE (7) π
okay bestie, so this is a page from the LIGHTNING-DATASTOREUSAGE manual β yes the whole name twice at the top, that's just how manpages do, iconic behavior honestly. it's all about datastoreusage, and ngl it's a little cutie.
β¨ NAME β¨
datastoreusage β the command for listing datastore usage info. that's it, that's the whole vibe π
πΈ SYNOPSIS πΈ
datastoreusage [key]
π¦ DESCRIPTION π¦
okay so first thing: this command was added in v23.11, so if you're on something ancient it simply does not exist, sorry bestie π
The datastoreusage RPC command lets the caller fetch the total bytes that are stored under a certain key (or from the root), including the size of the key itself. yes, the key's own size counts too, it's only fair π
All descendants of the key (or the root) are taken into account. every single one. the whole family tree. no cap π³
- key (one of, optional):
- (array of strings): Key is an array of values (though a single value is treated as a one-element array, cute right?). Used as the starting point to traverse the datastore.
- (string, optional)
- (string)
lowkey important: that second and third bullet are literally just(string, optional)and(string)in the original β not me being lazy, that's the actual documentation energy. i'm keeping it real, fr fr π
π₯ RETURN VALUE π₯
On success, an object containing datastoreusage is returned. and that object contains:
key(string): The key from which the database was traversed. (added v23.11)total_bytes(u64): The total bytes that are stored under the key, including the all descendants data and the size of the keys themselves. (added v23.11)
so yeah, total_bytes counts the descendants and the key sizes. it's giving thorough π
π AUTHOR π
Peter Neuroth pet.v.ne@gmail.com is mainly responsible. thank you Peter, you ate π
π SEE ALSO π
go read those next, bestie, they're the sibling group chat π«Ά
β RESOURCES β
Main web site: https://github.com/ElementsProject/lightning
π EXAMPLES π
Example 1:
Request:
$ lightning-cli datastoreusage
{
"id": "example:datastoreusage#1",
"method": "datastoreusage",
"params": {}
}
Response:
{
"datastoreusage": {
"key": "[]",
"total_bytes": 2909
}
}
Example 2:
Request:
$ lightning-cli datastoreusage -k "key"='["test", "name"]'
{
"id": "example:datastoreusage#2",
"method": "datastoreusage",
"params": {
"key": [
"test",
"name"
]
}
}
Response:
{
"datastoreusage": {
"key": "[test,name]",
"total_bytes": 33
}
}
Example 3:
Request:
$ lightning-cli datastoreusage -k "key"="otherkey"
{
"id": "example:datastoreusage#3",
"method": "datastoreusage",
"params": {
"key": "otherkey"
}
}
Response:
{
"datastoreusage": {
"key": "[otherkey]",
"total_bytes": 54
}
}
k that's the whole page!! πΈ this masterpiece is brought to you by Core Lightning v26.06.9, mwah, go check your datastore usage, 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