core-lightning/doc/lightning-listdatastore.7.md
Peter Neuroth aab948e538 datastore: Add datastoreusage command
datastoreusage returns the total_bytes that are stored under a given
{Key} or from root. {Key} is the entry point from which we begin to
traverse the datastore.

Changelog-Added: JSON-RPC: `datastoreusage`: returns the total bytes that are stored under a given key.

Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
2023-10-26 12:58:04 +10:30

1.3 KiB

lightning-listdatastore -- Command for listing (plugin) data

SYNOPSIS

listdatastore [key]

DESCRIPTION

The listdatastore RPC command allows plugins to fetch data which was stored in the Core Lightning database.

All immediate children of the key (or root children) are returned: a key with children won't have a hex or generation entry.

RETURN VALUE

On success, an object containing datastore is returned. It is an array of objects, where each object contains:

  • key (array of strings):
    • Part of the key added to the datastore
  • generation (u64, optional): The number of times this has been updated
  • hex (hex, optional): The hex data from the datastore
  • string (string, optional): The data as a string, if it's valid utf-8

The following error codes may occur:

  • -32602: invalid parameters.

AUTHOR

Rusty Russell <rusty@rustcorp.com.au> is mainly responsible.

SEE ALSO

lightning-datastore(7), lightning-deldatastore(7), lightning-datastoreusage(7)

RESOURCES

Main web site: https://github.com/ElementsProject/lightning