Skip to content

Commit

Permalink
doc: schema for listconfigs, compare with documentation.
Browse files Browse the repository at this point in the history
This made me document what are options are now in plugins, too.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Jun 11, 2021
1 parent 0f720dc commit 61f4034
Show file tree
Hide file tree
Showing 8 changed files with 482 additions and 68 deletions.
7 changes: 6 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,15 @@ clean: doc-clean
check: check-manpages

# This needs plugins, too.
check-manpages: all-programs
check-manpages: all-programs check-config-docs
@tools/check-manpage.sh cli/lightning-cli doc/lightning-cli.1.md
@tools/check-manpage.sh "lightningd/lightningd --lightning-dir=/tmp/" doc/lightningd-config.5.md

# Makes sure that fields mentioned in schema are in man page, and vice versa.
check-config-docs:
@for c in `sed -n 's/^ "\(.*\)": {/\1/p' doc/schemas/listconfigs.schema.json | grep -v '^# version$$' | grep -v '^plugins$$' | grep -v '^important-plugins$$'`; do if ! grep -q "^ \*\*$$c\*\*" doc/lightningd-config.5.md; then echo "$$c undocumented!"; exit 1; fi; done
@for c in `grep -v '\[plugin ' doc/lightningd-config.5.md | sed -n 's/^ \*\*\([^*]*\)\*\*.*/\1/p' | grep -v '^\(help\|version\|mainnet\|testnet\|signet\|plugin\|important-plugin\|plugin-dir\|clear-plugins\)$$'`; do if ! grep -q '^ "'"$$c"'"' doc/schemas/listconfigs.schema.json; then echo "$$c documented but not in schema!"; exit 1; fi; done

doc-maintainer-clean:
$(RM) $(MANPAGES)

Expand Down
29 changes: 19 additions & 10 deletions doc/lightning-checkmessage.7

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions doc/lightning-checkmessage.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,16 @@ efficiently than trying each one, so performance is not a concern.
RETURN VALUE
------------

On correct usage, an object with attribute *verified* will be
returned.
[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:
- **verified** (boolean): Whether the signature was valid

If *verified* is true, the signature was generated by the returned
*pubkey* for that given message. *pubkey* is the one specified as
input, or if none was specified, the known node which must have
produced this signature.
If **verified** is *true*:
- **pubkey** (pubkey): the *pubkey* parameter, or the pubkey found by looking for known nodes

If *verified* is false, the signature is meaningless. *pubkey* may
also be returned, which is they *pubkey* (if any) for which this
signature would be valid. This is usually not useful.
If **verified** is *false*:
- **pubkey** (pubkey): the *pubkey* (if any) which could have signed this; this is usually not useful!
[comment]: # (GENERATE-FROM-SCHEMA-END)

AUTHOR
------
Expand All @@ -50,3 +49,4 @@ RESOURCES

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

[comment]: # ( SHA256STAMP:8e4f2cd725b1a739785ffb9472656a08888c3837b31baaeabc855c08fa2f191d)
127 changes: 115 additions & 12 deletions doc/lightning-listconfigs.7

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 61 additions & 11 deletions doc/lightning-listconfigs.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ DESCRIPTION

The **listconfigs** RPC command to list all configuration options, or with *config*, just that one.

The returned values reflect the current configuration, including
showing default values (`dev-` options are not shown).

EXAMPLE JSON REQUEST
--------------------

Expand All @@ -27,18 +30,64 @@ EXAMPLE JSON REQUEST
RETURN VALUE
------------

On success, an object is returned with members reflecting the
corresponding lightningd-config(5) options which were specified in
the configuration file(s) and command line.

Additional members include:
[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:
- **# version** (string, optional): Special field indicating the current version
- **plugins** (array of objects, optional):
- **path** (string): Full path of the plugin
- **name** (string): short name of the plugin
- **options** (object, optional): Specific options set for this plugin:
- **important-plugins** (array of objects, optional):
- **path** (string): Full path of the plugin
- **name** (string): short name of the plugin
- **options** (object, optional): Specific options set for this plugin:
- **conf** (string, optional): `conf` field from cmdline, or default
- **lightning-dir** (string, optional): `lightning-dir` field from config or cmdline, or default
- **network** (string, optional): `network` field from config or cmdline, or default
- **allow-deprecated-apis** (boolean, optional): `allow-deprecated-apis` field from config or cmdline, or default
- **rpc-file** (string, optional): `rpc-file` field from config or cmdline, or default
- **disable-plugin** (array of strings, optional):
- `disable-plugin` field from config or cmdline
- **always-use-proxy** (boolean, optional): `always-use-proxy` field from config or cmdline, or default
- **daemon** (boolean, optional): `daemon` field from config or cmdline, or default
- **wallet** (string, optional): `wallet` field from config or cmdline, or default
- **large-channels** (boolean, optional): `large-channels` field from config or cmdline, or default
- **experimental-dual-fund** (boolean, optional): `experimental-dual-fund` field from config or cmdline, or default
- **experimental-onion-messages** (boolean, optional): `experimental-onion-messages` field from config or cmdline, or default
- **experimental-offers** (boolean, optional): `experimental-offers` field from config or cmdline, or default
- **experimental-shutdown-wrong-funding** (boolean, optional): `experimental-shutdown-wrong-funding` field from config or cmdline, or default
- **rgb** (hex, optional): `rgb` field from config or cmdline, or default (always 6 characters)
- **alias** (string, optional): `alias` field from config or cmdline, or default
- **pid-file** (string, optional): `pid-file` field from config or cmdline, or default
- **ignore-fee-limits** (boolean, optional): `ignore-fee-limits` field from config or cmdline, or default
- **watchtime-blocks** (u32, optional): `watchtime-blocks` field from config or cmdline, or default
- **max-locktime-blocks** (u32, optional): `max-locktime-blocks` field from config or cmdline, or default
- **funding-confirms** (u32, optional): `funding-confirms` field from config or cmdline, or default
- **cltv-delta** (u32, optional): `cltv-delta` field from config or cmdline, or default
- **cltv-final** (u32, optional): `cltv-final` field from config or cmdline, or default
- **commit-time** (u32, optional): `commit-time` field from config or cmdline, or default
- **fee-base** (u32, optional): `fee-base` field from config or cmdline, or default
- **rescan** (integer, optional): `rescan` field from config or cmdline, or default
- **fee-per-satoshi** (u32, optional): `fee-per-satoshi` field from config or cmdline, or default
- **max-concurrent-htlcs** (u32, optional): `max-concurrent-htlcs` field from config or cmdline, or default
- **min-capacity-sat** (u64, optional): `min-capacity-sat` field from config or cmdline, or default
- **addr** (string, optional): `addr` field from config or cmdline (can be more than one)
- **announce-addr** (string, optional): `announce-addr` field from config or cmdline (can be more than one)
- **bind-addr** (string, optional): `bind-addr` field from config or cmdline (can be more than one)
- **offline** (boolean, optional): `true` if `offline` was set in config or cmdline
- **autolisten** (boolean, optional): `autolisten` field from config or cmdline, or default
- **proxy** (string, optional): `proxy` field from config or cmdline, or default
- **disable-dns** (boolean, optional): `true` if `disable-dns` was set in config or cmdline
- **encrypted-hsm** (boolean, optional): `true` if `encrypted-hsm` was set in config or cmdline
- **rpc-file-mode** (string, optional): `rpc-file-mode` field from config or cmdline, or default
- **log-level** (string, optional): `log-level` field from config or cmdline, or default
- **log-prefix** (string, optional): `log-prefix` field from config or cmdline, or default
- **log-file** (string, optional): `log-file` field from config or cmdline, or default
- **log-timestamps** (boolean, optional): `log-timestamps` field from config or cmdline, or default
- **subdaemon** (string, optional): `subdaemon` fields from config or cmdline if any (can be more than one)
- **tor-service-password** (string, optional): `tor-service-password` field from config or cmdline, if any
[comment]: # (GENERATE-FROM-SCHEMA-END)

- *# version*: A string that represents the version of node.
- *plugins*: A array that represents the non-important plugin registered. Each object contains the following members:
- *path*: A string that represents the path of plugin.
- *name*: A string that represents the name of plugin.
- *options*: A object that contains all options accepted from command line or configuration file, if the plugin has opitions
- *important-plugins*: An array that represents all important plugins registered to the node. Each object contains the same members as the *plugin* array.

On failure, one of the following error codes may be returned:

Expand Down Expand Up @@ -154,3 +203,4 @@ RESOURCES
---------

Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:5b82e17199b32a1e88f09d6ee678884cd6e6e944f36f2233fb65bfee9381a32c)
Loading

0 comments on commit 61f4034

Please sign in to comment.