Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

lightning-datastore - Command for storing (plugin) data

datastore key [string] [hex] [mode] [generation]

The datastore RPC command allows plugins to store data in the c-lightning database, for later retrieval.

key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ "summary" ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically.

mode is one of "must-create" (default, fails it it already exists), "must-replace" (fails it it doesn't already exist), "create-or-replace" (never fails), "must-append" (must already exist, append this to what's already there) or "create-or-append" (append if anything is there, otherwise create).

generation, if specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode "must-replace" or "must-append".

On success, an object is returned, containing:

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 which has been added to the datastore
string (string, optional): The data as a string, if it's valid utf-8

The following error codes may occur:

1202: The key already exists (and mode said it must not)
1203: The key does not exist (and mode said it must)
1204: The generation was wrong (and generation was specified)
1205: The key has children already.
1206: One of the parents already exists with a value.
-32602: invalid parameters

Rusty Russell <> is mainly responsible.

lightning-listdatastore(7), lightning-deldatastore(7)

Main web site:

Search for    or go to Top of page |  Section 7 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.