Skip to content

Commit

Permalink
doc: generate correct markdown from schemas.
Browse files Browse the repository at this point in the history
You can't start a list without a paragraph separator.

```diff
 --- /tmp/before	2022-07-20 22:02:23.485372596 +0930
 +++ /tmp/after	2022-07-20 22:02:33.745528456 +0930
 @@ -21,12 +21,16 @@
         On startup of the daemon, no autoclean is set up.
  
  RETURN VALUE
 -       On success, an object is returned,  containing:  -  enabled  (boolean):
 -       whether invoice autocleaning is active
 +       On success, an object is returned, containing:
  
 -       If enabled is true: - expired_by (u64): how long an invoice must be ex‐
 -       pired (seconds) before we delete it - cycle_seconds (u64): how long  an
 -       invoice must be expired (seconds) before we delete it
 +       • enabled (boolean): whether invoice autocleaning is active
 +
 +       If enabled is true:
 +
 +       • expired_by (u64): how long an invoice must be expired  (seconds)  be‐
 +         fore we delete it
 +       • cycle_seconds  (u64):  how  long an invoice must be expired (seconds)
 +         before we delete it
  
  AUTHOR
         ZmnSCPxj <[email protected]> is mainly responsible.
```

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and niftynei committed Sep 13, 2022
1 parent 237d16f commit 9ce6b6c
Show file tree
Hide file tree
Showing 77 changed files with 141 additions and 5 deletions.
2 changes: 2 additions & 0 deletions doc/lightning-autocleaninvoice.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **enabled** (boolean): whether invoice autocleaning is active

If **enabled** is *true*:

- **expired_by** (u64): how long an invoice must be expired (seconds) before we delete it
- **cycle_seconds** (u64): how long an invoice must be expired (seconds) before we delete it

Expand Down
1 change: 1 addition & 0 deletions doc/lightning-check.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **command_to_check** (string): the *command_to_check* argument

[comment]: # (GENERATE-FROM-SCHEMA-END)
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-checkmessage.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **verified** (boolean): whether the signature was valid (always *true*)
- **pubkey** (pubkey): the *pubkey* parameter, or the pubkey found by looking for known nodes

Expand Down
2 changes: 2 additions & 0 deletions doc/lightning-close.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **type** (string): Whether we successfully negotiated a mutual close, closed without them, or discarded not-yet-opened channel (one of "mutual", "unilateral", "unopened")

If **type** is "mutual" or "unilateral":

- **tx** (hex): the raw bitcoin transaction used to close the channel (if it was open)
- **txid** (txid): the transaction id of the *tx* field

Expand Down
1 change: 1 addition & 0 deletions doc/lightning-commando-rune.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **rune** (string): the resulting rune
- **unique_id** (string): the id of this rune: this is set at creation and cannot be changed (even as restrictions are added)

Expand Down
3 changes: 3 additions & 0 deletions doc/lightning-connect.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,19 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **id** (pubkey): the peer we connected to
- **features** (hex): BOLT 9 features bitmap offered by peer
- **direction** (string): Whether they initiated connection or we did (one of "in", "out")
- **address** (object): Address information (mainly useful if **direction** is *out*):
- **type** (string): Type of connection (*torv2*/*torv3* only if **direction** is *out*) (one of "local socket", "ipv4", "ipv6", "torv2", "torv3")

If **type** is "local socket":

- **socket** (string): socket filename

If **type** is "ipv4", "ipv6", "torv2" or "torv3":

- **address** (string): address in expected format for **type**
- **port** (u16): port number

Expand Down
1 change: 1 addition & 0 deletions doc/lightning-createinvoice.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **label** (string): the label for the invoice
- **payment_hash** (hash): the hash of the *payment_preimage* which will prove payment (always 64 characters)
- **status** (string): Whether it has been paid, or can no longer be paid (one of "paid", "expired", "unpaid")
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-createonion.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **onion** (hex): the onion packet (*onion_size* bytes)
- **shared_secrets** (array of secrets): one shared secret for each node in the *hops* parameter:
- the shared secret with this hop (always 64 characters)
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-datastore.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
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
Expand Down
8 changes: 8 additions & 0 deletions doc/lightning-decode.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **type** (string): what kind of object it decoded to (one of "bolt12 offer", "bolt12 invoice", "bolt12 invoice_request", "bolt11 invoice", "rune")
- **valid** (boolean): if this is false, you *MUST* not use the result except for diagnostics!

If **type** is "bolt12 offer", and **valid** is *true*:

- **offer_id** (hex): the id of this offer (merkle hash of non-signature fields) (always 64 characters)
- **node_id** (point32): x-only public key of the offering node
- **description** (string): the description of the purpose of the offer
Expand Down Expand Up @@ -64,10 +66,12 @@ If **type** is "bolt12 offer", and **valid** is *true*:
- **warning_offer_unknown_currency**: The currency code is unknown (so no **minor_unit**)

If **type** is "bolt12 offer", and **valid** is *false*:

- the following warnings are possible:
- **warning_offer_missing_description**: No **description**

If **type** is "bolt12 invoice", and **valid** is *true*:

- **node_id** (point32): x-only public key of the offering node
- **signature** (bip340sig): BIP-340 signature of the *node_id* on this offer
- **amount_msat** (msat): the amount in bitcoin
Expand Down Expand Up @@ -100,6 +104,7 @@ If **type** is "bolt12 invoice", and **valid** is *true*:
- **refund_signature** (bip340sig, optional): the payer key signature to get a refund

If **type** is "bolt12 invoice", and **valid** is *false*:

- **fallbacks** (array of objects, optional):
- the following warnings are possible:
- **warning_invoice_fallbacks_version_invalid**: **version** is > 16
Expand All @@ -116,6 +121,7 @@ If **type** is "bolt12 invoice", and **valid** is *false*:
- **warning_invoice_refund_missing_signature**: No **refund_signature**

If **type** is "bolt12 invoice_request", and **valid** is *true*:

- **offer_id** (hex): the id of the offer this is requesting (merkle hash of non-signature fields) (always 64 characters)
- **payer_key** (point32): the transient key which identifies the payer
- **chain** (hex, optional): which blockchain this invoice_request is for (missing implies bitcoin mainnet only) (always 64 characters)
Expand All @@ -128,13 +134,15 @@ If **type** is "bolt12 invoice_request", and **valid** is *true*:
- **recurrence_signature** (bip340sig, optional): the payer key signature

If **type** is "bolt12 invoice_request", and **valid** is *false*:

- the following warnings are possible:
- **warning_invoice_request_missing_offer_id**: No **offer_id**
- **warning_invoice_request_missing_payer_key**: No **payer_key**
- **warning_invoice_request_missing_recurrence_signature**: No **recurrence_signature**
- **warning_invoice_request_invalid_recurrence_signature**: **recurrence_signature** incorrect

If **type** is "bolt11 invoice", and **valid** is *true*:

- **currency** (string): the BIP173 name for the currency
- **created_at** (u64): the UNIX-style timestamp of the invoice
- **expiry** (u64): the number of seconds this is valid after *timestamp*
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-decodepay.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **currency** (string): the BIP173 name for the currency
- **created_at** (u64): the UNIX-style timestamp of the invoice
- **expiry** (u64): the number of seconds this is valid after *timestamp*
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-deldatastore.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
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
Expand Down
3 changes: 3 additions & 0 deletions doc/lightning-delinvoice.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Note: The return is the same as an object from lightning-listinvoice(7).

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **label** (string): Unique label given at creation time
- **payment_hash** (hash): the hash of the *payment_preimage* which will prove payment (always 64 characters)
- **status** (string): State of invoice (one of "paid", "expired", "unpaid")
Expand All @@ -36,10 +37,12 @@ On success, an object is returned, containing:
- **description** (string, optional): description used in the invoice

If **bolt12** is present:

- **local_offer_id** (hex, optional): offer for which this invoice was created
- **payer_note** (string, optional): the optional *payer_note* from invoice_request which created this invoice

If **status** is "paid":

- **pay_index** (u64): unique index for this invoice payment
- **amount_received_msat** (msat): how much was actually received
- **paid_at** (u64): UNIX timestamp of when payment was received
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-delpay.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ payments will be returned -- one payment object for each partid.

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object containing **payments** is returned. It is an array of objects, where each object contains:

- **id** (u64): unique ID for this payment attempt
- **payment_hash** (hex): the hash of the *payment_preimage* which will prove payment (always 64 characters)
- **status** (string): status of the payment (one of "pending", "failed", "complete")
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-disableoffer.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Note: the returned object is the same format as **listoffers**.

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **offer_id** (hex): the merkle hash of the offer (always 64 characters)
- **active** (boolean): Whether the offer can produce invoices/payments (always *false*)
- **single_use** (boolean): Whether the offer is disabled after first successful use
Expand Down
2 changes: 2 additions & 0 deletions doc/lightning-feerates.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **perkb** (object, optional): If *style* parameter was perkb:
- **min_acceptable** (u32): The smallest feerate that you can use, usually the minimum relayed feerate of the backend
- **max_acceptable** (u32): The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet).
Expand All @@ -72,6 +73,7 @@ On success, an object is returned, containing:
- **htlc_success_satoshis** (u64): Estimated cost of typical HTLC fulfillment transaction

The following warnings may also be returned:

- **warning_missing_feerates**: Some fee estimates are missing

[comment]: # (GENERATE-FROM-SCHEMA-END)
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-fetchinvoice.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **invoice** (string): The BOLT12 invoice we fetched
- **changes** (object): Summary of changes from offer:
- **description_appended** (string, optional): extra characters appended to the *description* field.
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-fundchannel.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **tx** (hex): The raw transaction which funded the channel
- **txid** (txid): The txid of the transaction which funded the channel
- **outnum** (u32): The 0-based output index showing which output funded the channel
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-fundchannel_cancel.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **cancelled** (string): A message indicating it was cancelled by RPC

[comment]: # (GENERATE-FROM-SCHEMA-END)
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-fundchannel_complete.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **channel_id** (hex): The channel_id of the resulting channel (always 64 characters)
- **commitments_secured** (boolean): Indication that channel is safe to use (always *true*)

Expand Down
2 changes: 2 additions & 0 deletions doc/lightning-fundchannel_start.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **funding_address** (string): The address to send funding to for the channel. DO NOT SEND COINS TO THIS ADDRESS YET.
- **scriptpubkey** (hex): The raw scriptPubkey for the address
- **close_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`
- **mindepth** (u32, optional): Number of confirmations before we consider the channel active.

The following warnings may also be returned:

- **warning_usage**: A warning not to prematurely broadcast the funding transaction (always present!)

[comment]: # (GENERATE-FROM-SCHEMA-END)
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-funderupdate.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **summary** (string): Summary of the current funding policy e.g. (match 100)
- **policy** (string): Policy funder plugin will use to decide how much captial to commit to a v2 open channel request (one of "match", "available", "fixed")
- **policy_mod** (u32): The *policy_mod* is the number or 'modification' to apply to the policy.
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-fundpsbt.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **psbt** (string): Unsigned PSBT which fulfills the parameters given
- **feerate_per_kw** (u32): The feerate used to create the PSBT, in satoshis-per-kiloweight
- **estimated_final_weight** (u32): The estimated weight of the transaction once fully signed
Expand Down
3 changes: 3 additions & 0 deletions doc/lightning-getinfo.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **id** (pubkey): The public key unique to this node
- **alias** (string): The fun alias this node will advertize (up to 32 characters)
- **color** (hex): The favorite RGB color this node will advertize (always 6 characters)
Expand All @@ -49,6 +50,7 @@ On success, an object is returned, containing:
- **port** (u16): port number

If **type** is "dns", "ipv4", "ipv6", "torv2" or "torv3":

- **address** (string): address in expected format for **type**
- **binding** (array of objects, optional): The addresses we are listening on:
- **type** (string): Type of connection (one of "local socket", "ipv4", "ipv6", "torv2", "torv3")
Expand All @@ -57,6 +59,7 @@ On success, an object is returned, containing:
- **socket** (string, optional): socket filename (only if **type** is "local socket")

The following warnings may also be returned:

- **warning_bitcoind_sync**: Bitcoind is not up-to-date with network.
- **warning_lightningd_sync**: Lightningd is still loading latest blocks from bitcoind.

Expand Down
4 changes: 4 additions & 0 deletions doc/lightning-getlog.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,26 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **created_at** (string): UNIX timestamp with 9 decimal places, when logging was initialized
- **bytes_used** (u32): The number of bytes used by logging records
- **bytes_max** (u32): The bytes_used values at which records will be trimmed
- **log** (array of objects):
- **type** (string) (one of "SKIPPED", "BROKEN", "UNUSUAL", "INFO", "DEBUG", "IO_IN", "IO_OUT")

If **type** is "SKIPPED":

- **num_skipped** (u32): number of unprinted log entries (deleted or below *level* parameter)

If **type** is "BROKEN", "UNUSUAL", "INFO" or "DEBUG":

- **time** (string): UNIX timestamp with 9 decimal places after **created_at**
- **source** (string): The particular logbook this was found in
- **log** (string): The actual log message
- **node_id** (pubkey, optional): The peer this is associated with

If **type** is "IO_IN" or "IO_OUT":

- **time** (string): Seconds after **created_at**, with 9 decimal places
- **source** (string): The particular logbook this was found in
- **log** (string): The associated log message
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-getroute.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object containing **route** is returned. It is an array of objects, where each object contains:

- **id** (pubkey): The node at the end of this hop
- **channel** (short_channel_id): The channel joining these nodes
- **direction** (u32): 0 if this channel is traversed from lesser to greater **id**, otherwise 1
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-help.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **help** (array of objects):
- **command** (string): the command
- **category** (string): the category for this command (useful for grouping)
Expand Down
2 changes: 2 additions & 0 deletions doc/lightning-invoice.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,14 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **bolt11** (string): the bolt11 string
- **payment_hash** (hash): the hash of the *payment_preimage* which will prove payment (always 64 characters)
- **payment_secret** (secret): the *payment_secret* to place in the onion (always 64 characters)
- **expires_at** (u64): UNIX timestamp of when invoice expires

The following warnings may also be returned:

- **warning_capacity**: even using all possible channels, there's not enough incoming capacity to pay this invoice.
- **warning_offline**: there would be enough incoming capacity, but some channels are offline, so there isn't.
- **warning_deadends**: there would be enough incoming capacity, but some channels are dead-ends (no other public channels from those peers), so there isn't.
Expand Down
2 changes: 2 additions & 0 deletions doc/lightning-keysend.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:

- **payment_preimage** (secret): the proof of payment: SHA256 of this **payment_hash** (always 64 characters)
- **payment_hash** (hash): the hash of the *payment_preimage* which will prove payment (always 64 characters)
- **created_at** (number): the UNIX timestamp showing when this payment was initiated
Expand All @@ -77,6 +78,7 @@ On success, an object is returned, containing:
- **destination** (pubkey, optional): the final destination of the payment

The following warnings may also be returned:

- **warning_partial_completion**: Not all parts of a multi-part payment have completed

[comment]: # (GENERATE-FROM-SCHEMA-END)
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-listchannels.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ RETURN VALUE

[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object containing **channels** is returned. It is an array of objects, where each object contains:

- **source** (pubkey): the source node
- **destination** (pubkey): the destination node
- **short_channel_id** (short_channel_id): short channel id of channel
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-listconfigs.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ RETURN VALUE

[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
Expand Down
Loading

0 comments on commit 9ce6b6c

Please sign in to comment.