diff --git a/doc/Makefile b/doc/Makefile index 51f216a4c..ab5496038 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -9,6 +9,7 @@ MANPAGES := doc/lightning-cli.1 \ doc/lightningd-config.5 \ doc/lightningd-rpc.7 \ doc/lightning-addgossip.7 \ + doc/lightning-autoclean-once.7 \ doc/lightning-autoclean-status.7 \ doc/lightning-batching.7 \ doc/lightning-bkpr-channelsapy.7 \ diff --git a/doc/index.rst b/doc/index.rst index 2b281b43f..9a778ca67 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -31,6 +31,7 @@ Core Lightning Documentation .. block_start manpages lightning-addgossip + lightning-autoclean-once lightning-autoclean-status lightning-batching lightning-bkpr-channelsapy diff --git a/doc/lightning-autoclean-once.7.md b/doc/lightning-autoclean-once.7.md new file mode 100644 index 000000000..e14de540e --- /dev/null +++ b/doc/lightning-autoclean-once.7.md @@ -0,0 +1,70 @@ +lightning-autoclean-once -- A single deletion of old invoices/payments/forwards +=============================================================================== + +SYNOPSIS +-------- + +**autoclean-once** *subsystem* *age* + +DESCRIPTION +----------- + +The **autoclean-once** RPC command tell the `autoclean` plugin to do a +single sweep to delete old entries. This is a manual alternative (or +addition) to the various `autoclean-...-age` parameters which +cause autoclean to run once per hour: see lightningd-config(5). + +The *subsystem*s currently supported are: + +* `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`). +* `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`). +* `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`). +* `succededpays`: payment attempts which succeeded (`complete` in listpays `status`). +* `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`). +* `paidinvoices`: invoices which were paid (`paid` in listinvoices `status). + +*age* is a non-zero number in seconds. + +RETURN VALUE +------------ + +[comment]: # (GENERATE-FROM-SCHEMA-START) +On success, an object containing **autoclean** is returned. It is an object containing: + +- **succeededforwards** (object, optional): + - **cleaned** (u64): total number of deletions done this run + - **uncleaned** (u64): the total number of entries *not* deleted this run +- **failedforwards** (object, optional): + - **cleaned** (u64): total number of deletions done this run + - **uncleaned** (u64): the total number of entries *not* deleted this run +- **succeededpays** (object, optional): + - **cleaned** (u64): total number of deletions done this run + - **uncleaned** (u64): the total number of entries *not* deleted this run +- **failedpays** (object, optional): + - **cleaned** (u64): total number of deletions done this run + - **uncleaned** (u64): the total number of entries *not* deleted this run +- **paidinvoices** (object, optional): + - **cleaned** (u64): total number of deletions done this run + - **uncleaned** (u64): the total number of entries *not* deleted this run +- **expiredinvoices** (object, optional): + - **cleaned** (u64): total number of deletions done this run + - **uncleaned** (u64): the total number of entries *not* deleted this run + +[comment]: # (GENERATE-FROM-SCHEMA-END) + +AUTHOR +------ + +Rusty Russell <> is mainly responsible. + +SEE ALSO +-------- + +lightningd-config(5), lightning-autoclean-status(7) + +RESOURCES +--------- + +Main web site: + +[comment]: # ( SHA256STAMP:eebeb7600540caf66857b98c384ae7ee9a2a651398a7aec005703e71e72a6d62) diff --git a/doc/schemas/autoclean-once.request.json b/doc/schemas/autoclean-once.request.json new file mode 100644 index 000000000..9cc415162 --- /dev/null +++ b/doc/schemas/autoclean-once.request.json @@ -0,0 +1,27 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "subsystem", + "age" + ], + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "succeededforwards", + "failedforwards", + "succeededpays", + "failedpays", + "paidinvoices", + "expiredinvoices" + ], + "description": "What subsystem to clean" + }, + "age": { + "type": "u64", + "description": "How many seconds old an entry must be to delete it" + } + } +} diff --git a/doc/schemas/autoclean-once.schema.json b/doc/schemas/autoclean-once.schema.json new file mode 100644 index 000000000..36e4969bf --- /dev/null +++ b/doc/schemas/autoclean-once.schema.json @@ -0,0 +1,124 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": true, + "required": [ + "autoclean" + ], + "properties": { + "autoclean": { + "type": "object", + "additionalProperties": false, + "properties": { + "succeededforwards": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": "total number of deletions done this run" + }, + "uncleaned": { + "type": "u64", + "description": "the total number of entries *not* deleted this run" + } + } + }, + "failedforwards": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": "total number of deletions done this run" + }, + "uncleaned": { + "type": "u64", + "description": "the total number of entries *not* deleted this run" + } + } + }, + "succeededpays": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": "total number of deletions done this run" + }, + "uncleaned": { + "type": "u64", + "description": "the total number of entries *not* deleted this run" + } + } + }, + "failedpays": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": "total number of deletions done this run" + }, + "uncleaned": { + "type": "u64", + "description": "the total number of entries *not* deleted this run" + } + } + }, + "paidinvoices": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": "total number of deletions done this run" + }, + "uncleaned": { + "type": "u64", + "description": "the total number of entries *not* deleted this run" + } + } + }, + "expiredinvoices": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": "total number of deletions done this run" + }, + "uncleaned": { + "type": "u64", + "description": "the total number of entries *not* deleted this run" + } + } + } + } + } + } +}