Commit Graph

58 Commits

Author SHA1 Message Date
Rusty Russell c31fb99d2d doc: add lightingd-rpc documentation.
This documents how to communicate with lightningd over RPC, including
use of the `filter` object.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Documentation: `lightningd-rpc` manual page describes details of our JSON-RPC interface, including compatibility and filtering.
2022-11-09 20:25:58 +10:30
Rusty Russell fa7d732ba6 lightningd: allow a connection to specify db batching.
Previous commit was a hack which *always* batched where possible, this
is a more sophisticated opt-in varaint, with a timeout sanity check.

Final performance for cleaning up 1M pays/forwards/invoices:

```
$ time l1-cli autoclean-once succeededpays 1
{
   "autoclean": {
      "succeededpays": {
         "cleaned": 1000000,
         "uncleaned": 26895
      }
   }
}

real	6m9.828s
user	0m0.003s
sys	0m0.001s
$ time l2-cli autoclean-once succeededforwards 1
{
   "autoclean": {
      "succeededforwards": {
         "cleaned": 1000000,
         "uncleaned": 40
      }
   }
}

real	3m20.789s
user	0m0.004s
sys	0m0.001s
$ time l3-cli autoclean-once paidinvoices 1
{
   "autoclean": {
      "paidinvoices": {
         "cleaned": 1000000,
         "uncleaned": 0
      }
   }
}

real	6m47.941s
user	0m0.001s
sys	0m0.000s
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `batching` command to allow database transactions to cross multiple back-to-back JSON commands.
2022-09-22 15:19:46 +02:00
Rusty Russell 612f3de0d4 doc: manpages and schemas for autoclean-status.
And remove deprecated autocleaninvoice docs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Plugins: `autoclean-status` command to see what autoclean is doing.
Changelog-Deprecated: JSON-RPC: `autocleaninvoice` (use option `autoclean-expiredinvoices-age`)
2022-09-22 15:19:46 +02:00
Rusty Russell 3079afb024 lightningd: add `delforward` command.
Changelog-Added: JSON-RPC: `delforward` command to delete listforwards entries.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-09-22 15:19:46 +02:00
Rusty Russell 7420a7021f lightningd: add `listhtlcs` to list all the HTLCs we know about.
Using `listfowards` for this wrong; expose this directly if people
care (and unlike listforwards, which could be deleted, we have to
remember these while the channel is still open!).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `listhtlcs` new command to list all known HTLCS.
2022-09-22 15:19:46 +02:00
niftynei 563910e667 bkpr: add docs, change names to 'bkpr-*'
Adds schema definitions and manpages for bkpr- commands; also renames
the commands to all start with 'bkpr-', so they're easier to identify/
make runes about.
2022-07-28 12:08:18 +09:30
Rusty Russell cf28cff398 doc: document commando and commando-rune.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-07-17 08:51:02 +09:30
Rusty Russell 9685c1adaf lightningd: remove getsharedsecret.
This was introduced to allow creating a shared secret, but it's better to use
makesecret which creates unique secrets.  getsharedsecret being a generic ECDH
function allows the caller to initiate conversations as if it was us; this
is generally OK, since we don't allow untrusted API access, but the commando
plugin had to blacklist this for read-only runes explicitly.

Since @ZmnSCPxj never ended up using this after introducing it, simply
remove it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: JSONRPC: `getsharedsecret` API: use `makesecret`
2022-07-15 22:17:58 +09:30
adi2011 829fe09c13 doc: Add documentation for new RPCs and a FIXME: in fromschema.py 2022-07-14 12:24:48 -05:00
Rusty Russell 836c1b805b doc: update c-lightning to Core Lightning almost everywhere.
Mostly comments and docs: some places are actually paths, which
I have avoided changing.  We may migrate them slowly, particularly
when they're user-visible.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-07 06:53:26 +09:30
Rusty Russell 66e264d6b3 lightningd: new setchannel command.
Based on setchannelfee, but expanded to allow setting max htlc amount (and others
in future?).

The main differences:
1. It doesn't change values which are not specified (that would be hard to
   add fields to!)
2. It says exactly what all values are in any potentially changed channels.

Changelog-Added: JSON-RPC: new `setchannel` command generalizes `setchannelfee`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-03-22 18:45:41 +10:30
Rusty Russell 1b48545e5b JSON-RPC: add interfaces to access datastore.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `datastore`, `deldatastore` and `listdatastore` for plugins to store simple persistent key/value data.
2021-08-25 10:06:31 +02:00
niftynei 90c5f9a051 funderupdate: add documentation, update some params
Documentation for the funderupdate command on the funder plugin.
Realized we were missing the "leases_only" in the output; also adds
'_msat' to msat denominated outputs so they're parsed correctly by our
python bindings (also matches our naming conventions)

Changelog-EXPERIMENTAL: funder: `funderupdate` command to view and update params for contributing our wallet funds to v2 channel openings. Provides params for enabling `option_will_fund`.
2021-07-21 11:38:30 -04:00
niftynei 43ae30df21 chaintopology: new command 'parsefeerate'
Useful for parsing a passed in feerate before calling lightningd with
it, e.g. when you need to know what the feerate is for a fundpsbt before
calling fundpsbt

Changelog-Added: JSON-RPC: new command `parsefeerate` which takes a feerate string and returns the calculated perkw/perkb
2021-07-20 13:28:38 -04:00
niftynei 8654c817da sendcustommsg: promote to non-dev
Enable non-dev builds to send custom messages.

Preserves 'dev-' for compat-enabled builds.

Changelog-Changed: JSON-RPC: moved dev-sendcustommsg to sendcustommsg
2021-07-14 14:39:44 -05:00
Christian Decker 777f0b1145 doc: Remove leftover conflict marker in the docs 2021-03-22 12:33:16 +10:30
niftynei bec96a6c5b df: add openchannel_abort command
Allows us to clean up an in-progress open that we won't be completing

Changelog-Added: EXPERIMENTAL JSON-RPC: Permit user-initiated aborting of in-progress opens. Only valid for not-yet-committed opens and RBF-attempts
2021-03-15 14:08:44 +10:30
niftynei fc9e72b62b df-doc: add docs for openchannel_bump, more checks for valid psbt
Add docs for openchannel_bump, plus some checks that were missed for
verifying the amount is valid.
2021-03-12 14:00:19 +10:30
Rusty Russell 3e79cffd6e doc: add disableoffer and listoffers manpages.
I noticed that offer(7) referred to `deloffer` which doesn't exist.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-02-25 14:44:03 +10:30
Rusty Russell 9da191e034 docs: document addgossip API.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `addgossip` allows direct injection of network gossip messages.
2021-02-02 13:44:01 +01:00
Rusty Russell c4fe2e7f5a doc: Manual page for sendonionmessage.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-01-14 13:56:13 +01:00
Rusty Russell c08ff167b2 decode: new generic API to decode bolt11 and bolt12.
This is experimental for now, but can eventually deprecated
'decodepay' and even decode other kinds of messages.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-01-09 14:34:35 +10:30
Rusty Russell 1aa7e8e011 offers: split offer send_invoice generation into new JSON command
We split `send_invoice` offers inoo offerout (for want of a better name).
This simplifies the API.

Also took the opportunity to move the `vendor` tag to immediately
follow `description` (our tests use arguments by keywords, so no
change there).

Suggested-by: shesek
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-01-09 14:34:35 +10:30
Rusty Russell 47ce7ff0c1 doc: document experimental commands.
Not the low-level ones, just enough that people can play with the APIs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-01-09 14:34:35 +10:30
ZmnSCPxj jxPCSnmZ 0e326dd3a7 doc/BACKUP.md: Document backup strategies for `lightningd`.
ChangeLog-Added: Document: `doc/BACKUP.md` describes how to back up your C-lightning node.
2020-12-15 12:16:50 +01:00
Rusty Russell fab0842d31 lightningd: createinvoice low-level invoice creation command.
This takes an unsigned bolt11 (or bolt12 if EXPERIMENTAL_FEATURES) string
and signs it and puts it in the database.

The invoice command could now be moved out to a plugin, in fact.

Changelog-Added: JSON-RPC: `createinvoice` new low-level invoice creation API.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-12-15 12:05:02 +01:00
Rusty Russell c732d8707a JSON-RPC: notifications command.
This lets callers enable notifications; we won't send any if they don't.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `notifications` command to enable notifications.
2020-10-23 13:53:16 +10:30
niftynei 8858ae4f3d df-open: commands to update a PSBT or submit a signed PSBT
`openchannel_signed` and `openchannel_update` which allow a user to
continue a openchannel or kick off the completion of a openchannel.

`openchannel_update` should be called until it returns with
`commitments_secured`.
2020-10-20 12:50:31 +10:30
niftynei 06c41a0547 dualfund: opener, openchannel_init command (1/3)
There are 3 commands for opening a channel with dualfunding.
`openchannel_init` is the first of these.

It initializes the open-channel dialog, and stops once we've run out of
updates (input/outputs) to send to the peer.
2020-10-20 12:50:31 +10:30
Vincenzo Palazzo 9fbeb9bcdc delpay: code style changes and fixed docs
Changelog-Added: JSON-RPC: delpay a new method to delete the payment completed or failed.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2020-09-10 17:27:51 +09:30
ZmnSCPxj jxPCSnmZ 277ff0f44c plugins/spender/multiwithdraw.c: Implement multiwithdraw command.
Fixes: #2679

Changelog-Added: JSON-RPC: New `multiwithdraw` command to batch multiple onchain sends in a single transaction.  Note it shuffles inputs and outputs, does not use BIP69.
2020-09-09 20:36:08 +09:30
ZmnSCPxj jxPCSnmZ 9460838650 doc/, contrib/: Additional support etc. for multifundchannel. 2020-09-09 16:45:56 +09:30
Vincenzo Palazzo 0b0c5898ff Added doc file for the command getlog, help and listconfigs
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2020-09-08 14:55:29 +09:30
Vincenzo Palazzo 1a1b2f3d34 Start ping command and fix some convention in other new doc file
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2020-09-08 14:55:29 +09:30
Vincenzo Palazzo 5b1e181525 added documentation of command stop
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2020-09-08 14:55:29 +09:30
Vincenzo Palazzo d477a8d755 added sendpsbt documentation
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2020-09-08 14:55:29 +09:30
Vincenzo Palazzo d5a20b90b4 added documentation of commands listnodes, sendpsbt
Some grammar mistake was fixed as suggest and more command docs were added.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2020-09-08 14:55:29 +09:30
Vincenzo Palazzo 4c72a6b71f added documentation of command listtransactions
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2020-09-08 14:55:29 +09:30
Rusty Russell b07327a687 utxopsbt: new command to create PSBT from given utxos.
It's *possible* to do this using various RPC calls, but it's
unfriendly:

1. Call getinfo to get the current block height.
2. Call listfunds to map the UTXOs.
3. Create the PSBT and hope you get all the fields correct.

Instead, this presents an interface just like `fundpsbt`, with identical
returns.

I think it's different enough to justify a new command (though it
shares much internally, of course).

In particular, it's now quite simple to create a command which uses
specified utxos, and then adds more to meet any shortfall.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-08-18 12:52:41 +09:30
Rusty Russell 1091be3d0d doc: document fundpsbt.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-07-15 18:49:02 +09:30
Christian Decker 7978a13cae doc: Add a man-page for the new keysend command 2020-07-13 14:19:16 +02:00
Rusty Russell b1210eef52 doc: update since addition of feerate(7)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-07-13 04:22:24 +00:00
ZmnSCPxj jxPCSnmZ 5d720536e2 Makefile: Install `tools/hsmtool` as `lightning-hsmtool`.
Changelog-Added: We now install `lightning-hsmtool` for your `hsm_secret` needs.

See: https://github.com/ElementsProject/lightning/issues/3717#issuecomment-644844594

It seems reasonable to add this to the standard install, and to document it properly as well, hopefully we can fill in the documentation better later on.
2020-07-01 09:24:03 +09:30
niftynei a68d79e390 add manpages for reserve/unreserve 2020-06-29 16:10:05 +02:00
darosior b0c58f85ce doc: start an FAQ
This regroups questions (frequently) seen in Github issues, on IRC, and
also some I've been asked in face to face.

Changelog-Added: doc: An FAQ was added, accessible at https://lightning.readthedocs.io/FAQ.html

Christian wrote the block chain rescaning paragraph.
Lisa corrected my poor english grammar.
Co-Authored-by: Christian Decker <decker.christian@gmail.com>
Co-Authored-by: Lisa Neigut <niftynei@gmail.com>
2020-04-03 20:04:54 -05:00
ZmnSCPxj jxPCSnmZ d9b2482415 lightningd/hsm_control.c: Implement `getsharedsecret`.
ChangeLog-Added: New `getsharedsecret` command, which lets you compute a shared secret with this node knowing only a public point. This implements the BOLT standard of hashing the ECDH point, and is incompatible with ECIES.
2020-02-28 14:45:50 +10:30
Vasil Dimov 149620ee0f build: fix and simplify doc/index.rst generation
* Fix usage of `echo "...\n..."` (without `-e`), generating a
broken output:
```
   lightningd-config <lightningd-config.5.md>
   lightningd\nlightning-autocleaninvoice.7.md <lightningd.8.md\nlightning-autocleaninvoice.7.md>
```

* Use `$(SORT)` instead of bare `sort` to avoid locale-dependent sort.

* Strip the trailing .[0-9].md without invoking sed.

* Sort all man pages as one block.

Changelog-None
2020-02-03 15:38:11 +00:00
Christian Decker a3ddf9be9b docs: Add manpage for dev-sendcustommsg
It's a dev-* command for now, but better document it so people can use it
rather than having them guess how it's supposed to work.
2020-01-28 23:50:52 +01:00
darosior f619124cb9 doc: update readthedocs index 2020-01-27 16:24:12 +00:00
ZmnSCPxj 54cc735201 lightningd/peer_control.c: Implement waitblockheight.
This is needed to fully implement handling of blockheight disagreements
between us and payee.
If payee believes the blockheight is higher than ours, then `pay`
should wait for our node to achieve that blockheight.

Changelog-Add: Implement `waitblockheight` to wait for a specific blockheight.
2020-01-21 22:23:21 +01:00