Commit Graph

1130 Commits

Author SHA1 Message Date
ShahanaFarooqui
aff8f0ff5e doc: Updated dev command warning
Changelog-Changed: Documentation: Merged `example_json_request` and `example_json_response` in a single `json_examples` array to maintain the request and its corresponding response together.
2024-04-04 13:16:27 +10:30
ShahanaFarooqui
9e782f491b doc: updated schemas for json_examples 2024-04-04 13:16:27 +10:30
Rusty Russell
3483bff66b doc: document the rune conditions for parsing invoice strings.
This pre-promises an implementation, which we are now going to write!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-27 16:09:23 +10:30
Rusty Russell
4e086f28c3 lightningd: remove channels from listpeers.
Changelog-Removed: JSON-RPC: `listpeers` `channels` (deprecated v23.02, EOL v24.02)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-25 15:02:35 +10:30
Rusty Russell
ba922f9160 lightningd/connectd: remove --experimental-websocket-port
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: Config `experimental-websocket-port` (deprecated 23.08, EOL 24.02)
2024-03-25 15:02:35 +10:30
Rusty Russell
7e0e39460b lightningd: remove delexpiredinvoice
Changelog-Removed: JSON-RPC: `delexpiredinvoice` (deprecated v22.11, EOL v24.02)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-25 15:02:35 +10:30
bitkarrot
99aa519457 doc: Add json schema for dev-forget-channel 2024-03-21 20:12:37 -07:00
Rusty Russell
1321d35855 multifundchannel: fix amount argument in schema & docs (it can be "all").
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-21 19:52:56 +10:30
Rusty Russell
4816550b0f lightningd: check rune parameter names with and without punctuation.
Changelog-Changed: runes: named parameters (e.g. `pnameamountmsat`) no longer need to remove underscores (i.e. `pnameamount_msat` now works as expected).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-20 11:18:36 +10:30
Rusty Russell
7af045df4e pyln-testing: use DEBUG_LIGHTNINGD to start gdb on lightningd during test.
We do this for DEBUG_SUBD already, but I wanted to debug the main lightningd.

(We rename --debugger to the more accurate --dev-debug-self)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-20 11:18:36 +10:30
Rusty Russell
4a9b9b8b29 pay: add partial_msat option to make partial payment.
a.k.a. "Pay with a friend!".

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `pay` has a new parameter `partial_msat` to only pay part of an invoice (someone else presumably will pay the rest at the same time!)
Suggested-by: Calle
2024-03-20 10:58:28 +10:30
ShahanaFarooqui
9b83b8b967 doc: Delete markdowns as they will be generated by scripts now
This PR will generate doc/lightning-*.md file for rpc commands. It will get the information from consolidated doc/schemas/lightning-*.json file and use it to generate markdown file for RPC commands.

Changelog-Changed: Documentation: great documentation rewrite, all reference pages now generated from the fully-tested JSON schemas and include examples.
2024-03-19 14:58:59 +10:30
ShahanaFarooqui
f72b0fdabd docs: Updates script and fixed test to generate lightning-sql
- Updated doc/Makefile for generating schemas/lightning-sql.json
    - Read the lightning-sql template from schemas/lightning-sql-template.json
    - Generate sql tables data and merge it with json object read from above template
    - Save final merged object in schemas/lightning-sql.json
- Updated doc/Makefile to auto generate lightning-sql.7.md and lightning-sql.7
- Deleted schemas/lightning-sql.json and adding it into .gitignore
- Added lightning-sql specific titles in the fromschema.py script
- Fixed test_sql by changing the sequence for listpeerchannels `reestablished` field
- Ignoring lightning-sql.json for msggen schema.json because it is auto generated by sql plugin and lightning-sql-template.json.
2024-03-19 14:58:59 +10:30
ShahanaFarooqui
2c99f2e100 doc: Remove unused request.json and schema.json files 2024-03-19 14:58:59 +10:30
ShahanaFarooqui
418ecf3e42 script: Update scripts
- Update `make doc-all` script
- `fromschema.py` script
    - Updated to generate whole doc/lightning-*.md via doc/schemas/lightning-*.json file
    - Updated to print request params
    - Added `oneOfMany` condition for request params
    - Added `pairedWith` condition for request params
    - Added `dependentUpon` condition for request params
    - Updated for pre and post_return_value for response
    - Hiding `hidden` fields
    - `descriptions` are array now
    - Unified gaps between titles
    - Added default key-value pair

- script: msggen, sql-schema, listconfig and pyln-testing script updates

This does not add created markdowns for cleaner review. We will add the markdown files in a separate commit.
2024-03-19 14:58:59 +10:30
ShahanaFarooqui
4c370022d0 script: Updated sql-schema_gen and documented it's jq dependency. 2024-03-19 14:58:59 +10:30
ShahanaFarooqui
04884ca664 doc: Merge request and schema jsons in a single file
Merge information from `*.request.json` & `*.schema.json`. Also consolidate remaining details from `*.md` files and create a single file in schemas folder.
2024-03-19 14:58:59 +10:30
ShahanaFarooqui
fdc2dbdbc3 doc: Updated schemas *.schema.json
- Makes emergency schema stricter
- Fixes some formatting
2024-03-19 14:58:59 +10:30
Rusty Russell
d7cc1e4a17 doc: Updated parameter descriptions for *.request.json
Added descriptions for rpc command parameters

This also performs the following fixes:
1. delforward parameters are compulsory (required).
2. disableinvoicerequest request added `added` field.
3. invoice request order fixed (label then description, not vice-versa!).
4. listpeers log levels are a proper enum
5. description parameter documented for sendonion requests.
6. deprecatred amount_msat removed from sendpay request.
7. sendpay request partid type fixed to u64 (was u16!)
8. sendpay request localinvreqid type tightened to hash (was hex)
9. sendpay request payment_metadata and description fields documented.
10. sendpsbt request reserve type fixed to u32 (was boolean)
11. utxopsbt request satoshi type fixed to msat_or_all (was msat)
12. withdraw request parameter satoshi is compulsory (required)
13. fundchannel_start request amount is sat, not msat_or_all.
14. openchannel_init request amount is sat, not msat
15. openchannel_init close_to is a string, not hex.
16: invoice labels can be strings OR numbers.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-19 14:58:59 +10:30
ShahanaFarooqui
d9dd3a1840 doc: Adding missing *.schema.json
Adding missing *.schema.json files for rpc commands to create consolidated json files.
Updating and deleting other as per requirement.
2024-03-19 14:58:59 +10:30
ShahanaFarooqui
e8c8c8887b doc: Adding missing *.request.json
Some rpc commands did not have their corresponding *.request.json files to generate the consolidated json
2024-03-19 14:58:59 +10:30
ShahanaFarooqui
8615a87452 Add type currency for offers amount field. Eg.1.50USD. 2024-03-19 14:58:59 +10:30
Rusty Russell
f100b1cdf1 Add type sat.
We actually use this in multiple places for requests.  The key
difference between this and msat is what we do when presented with a
raw number!  I prefer insisting on explicit suffixes, for this reason,
but at least this will document the field correctly!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-19 14:58:59 +10:30
Rusty Russell
ee00f84fed JSON: don't return a raw result string for "stop" and "recover".
In general, results should always be an object, so we can add new fields
later (e.g. warnings!).  But we violated this for "stop", and when "recover"
used the same infrastructure, it started doing the same thing.

I'm assuming nobody cares, so we don't need to do a deprecation cycle.

Changelog-Changed: JSON-RPC: `stop` and `recover` now return a JSON object (not a raw string!) like every other command does.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-19 14:58:59 +10:30
Christian Decker
8418989f9b release: Unbreak the Fedora build
We have installation instructions that tell the user to use `poetry`
and then we ourselves think we're clever and install only a known
subset? It was only a matter of time until we broke this.

Changelog-None
2024-02-28 14:38:10 +01:00
Christian Decker
5e42f4681b release: Bump pyln package versions 2024-02-28 14:38:10 +01:00
Aditya Sharma
9acc1d7db6 peer_control: Add lost_state param inside listpeerchannels rpc, which'd help us identify if we've fall behind or lost some state. 2024-02-16 22:17:46 +01:00
jrakibi
1fdc018b74 Fix incorrect hex value for Signet port 2024-02-16 15:54:29 +01:00
Rusty Russell
6ed17e9e0c pyln-testing: dump gossip store when we complain about bad gossip.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-02-12 11:43:33 +01:00
Christian Decker
1e023a171d msggen: Regenerate with correct protobuf version 2024-02-09 14:19:43 +01:00
Christian Decker
4c4c74fa32 msggen: Regenerate to include offer and listoffers
Changelog-None Unrelease, so no notes needed.
2024-02-09 12:20:45 +01:00
Christian Decker
cfea45d827 make: Add missing dependency between schemas and schema bundle
Reported-by: microsatoshi
2024-02-09 12:20:45 +01:00
Christian Decker
a87643f3bf ci: Install python build dependencies in alpine image 2024-02-08 15:05:18 +01:00
Christian Decker
00fbd5977f msggen: Start making the msggen library a standalone tool
There are quite some things we want to generate from the schema
definitions, both inside and outside of CLN itself. By bundling the
schemas into the library we can make use of the tooling without
running in the CLN source tree. This is in part used to generate some
of the interfaces in Greenlight.

Changelog-None
2024-02-08 15:03:34 +01:00
saisuraj27
34aaa9c7ba Fixed indentation errors. 2024-02-08 12:37:34 +01:00
saisuraj27
a35006e701 Fixed raising TypeError instead of ValueError when there is an invalid type. 2024-02-08 12:37:34 +01:00
Rusty Russell
689e596036 options: make anchors enabled by default, ignore experimental-anchors.
We still want to test non-anchor channels, as we still support them, but
we've made it non-experimental.  To test non-anchor channels, we
use dev-force-features: -23.

Changelog-Added: Protocol: `option_anchors_zero_fee_htlc_tx` enabled, no longer experimental.
Changelog-Changed: Config: `experimental-anchors` now does nothing (it's enabled by default).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>


Header from folded patch 'fixup!_options__make_anchors_enabled_by_default,_ignore_experimental-anchors.patch':

fixup! options: make anchors enabled by default, ignore experimental-anchors.
2024-02-08 06:32:01 +10:30
Christian Decker
99aa1e827e msggen: Fix the offer schemas
I had to do some trickery with the interchangeability between string
and int, but now it works as expected.
2024-02-07 20:38:29 +01:00
Christian Decker
09d32ecff5 doc: Fix schema for offer.amount, it can be a non-BTC unit too
The `amount` field is intended to be either a native unit (`msat`,
`sat` or `btc`) or it can also be a non-native unit that needs to be
converted into native when creating the invoice. As such limiting the
`amount` to only be native is very restrictive.
2024-02-07 20:38:29 +01:00
vacwmX
317cf4d430 feat: added listoffers grpc command 2024-02-07 20:38:29 +01:00
vacwmX
d1052e3924 doc: adding schema to create offer requests 2024-02-07 20:38:29 +01:00
vacwmX
5eacb5b22e feat: adding offer command to pyln-testing and msggen 2024-02-07 20:38:29 +01:00
vacwmX
68bb1ff586 feat: grpc - adding support for Offer command 2024-02-07 20:38:29 +01:00
Graham Krizek
f5ddb89d83 Add a method to the pyln-client for using the sendcustommsg api 2024-02-07 13:17:30 +01:00
saisuraj27
fe09484bb9 Removed duplicate keys in some dictionaries. 2024-02-05 11:25:01 +01:00
Lagrang3
02663c5dee regtest: fix check for bitcoin-cli
Fixes startup_regtest test that checks if bitcoin-cli, bitcoind,
lightning-cli and lightningd are found as executables.
2024-02-04 16:54:53 +01:00
Rusty Russell
104d6a9c78 gossip_store: remove infratructure and bits for marking ratelimited entries.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-02-04 09:24:44 +10:30
Rusty Russell
07cd4a809b gossipd: remove spam handling.
We weakened this progressively over time, and gossip v1.5 makes spam
impossible by protocol, so we can wait until then.

Removing this code simplifies things a great deal!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: Protocol: we no longer ratelimit gossip messages by channel, making our code far simpler.
2024-02-04 09:24:44 +10:30
Rusty Russell
e7ceffd565 gossipd: remove zombie handling.
We never enabled it, because we seemed to be eliminating valid
channels.  We discard zombie-marked records on loading.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-02-04 09:24:44 +10:30
Lagrang3
9abd5ecf45 regtest: error message if bitcoin-cli is not found
If $BITCOIN_BIN is empty and bitcoin-cli or bitcoind are not found
startup_regtest will shutdown and display a corresponding error message.

Similarly if lightning-cli and lightningd are not found.
2024-02-02 17:25:50 +01:00