Commit Graph

1185 Commits

Author SHA1 Message Date
Gregory Sanders c4d4984cbf Travis is no longer used 2022-04-07 06:54:02 +09:30
Gregory Sanders 6b79eed2e8 there are four tests 2022-04-07 06:54:02 +09:30
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 d95ea51a73 lightning-cli: document the real argument handling (for special effects).
And fix it to pass through decimals like the man page promises!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-07 06:53:26 +09:30
Rusty Russell 356514c753 doc: note how to do Rust builds on Ubuntu, at least.
In particular, using cargo to install rustfmt doesn't work.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-07 06:53:26 +09:30
Clay Shoaf 17903c89f2
Update INSTALL.md
changed `make` to `poetry run make`.
Also moved the spot where `poetry install` is run as it wouldn't make sense to run it before the project is cloned.
2022-04-06 11:06:08 +09:30
kiwiidb 8ed6b7050b build: bump zlib dependency 2022-04-06 08:06:50 +09:30
Michael Schmoock e99f9ad6d6 doc: htlc_minimum_msat htlc_maximum_msat announce_discovered_ip
doc/schemas: adds htlc min/max and ip discovery
2022-04-05 05:45:04 +09:30
Rusty Russell e47786da04 pay/sendpay: also store description in case bolt11 uses description_hash.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-04 20:26:04 +09:30
Rusty Russell d5c736fe86 pay: require description if bolt11 only has hash.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `pay` has `description` parameter, will be required if bolt11 only has a hash.
Changelog-Deprecated: JSON-RPC: `pay` for a bolt11 which uses a `description_hash`, without setting `description`.
2022-04-04 20:26:04 +09:30
Rusty Russell 6c54e0e7e7 pay: add absolute "maxfee" parameter.
This is what LND does, and it's better for upper layers than trying to
twist our maxfeepercent / exemptfee heuristics to suit.

(I don't remember who complained about this, sorry!)

I'm doing this now because I want to add YA parameter next!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `pay` has new parameter `maxfee` for setting absolute fee (instead of using `maxfeepercent` and/or `exemptfee`)
2022-04-04 20:26:04 +09:30
Rusty Russell 713cd0540d doc: document `pay` localofferid field.
Fixes: #4665
Reported-by: @shesek
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-04 20:26:04 +09:30
Christian Decker 241a891190 cln-rpc: Yet more RPC methods being mapped
- disconnect
 - feerates
 - getroute
 - listforwards
 - listpays
 - ping
 - signmessage
2022-04-02 09:46:01 +10:30
Christian Decker 4aec3d3b9c doc: Annotate secrets and hashes in the JSON Schemas 2022-04-02 09:46:01 +10:30
Rusty Russell b45b731c55 doc/schemas: fixes for request schemas.
Types are fixed, in particular:

* rename "OutputDesc" to more consistent "outputdesc".
* rename "utxo" to more consistent "outpoint".
* it's "boolean" not "bool".
* "number" means int or float, usually it should be u32.

Specific commands:

* close `id` can be by channel id, scid.
* close `feerange` is a feerate type.
* datastore/deldatastore/listdatastore `key` can be singleton.
* delexpiredinvoice: `maxexpirytime` is not required, is a u64.
* invoice/delinvoice/listinvoice `label` can be an integer
* fundpsbt: many fields are u32 not number (JSON for int or float).
* invoice: `msatoshi` can be "any".
* invoice: `expiry` has a type (now must be numeric).
* invoice: `exposeprivatechannels` can be bool or array of scids.
* invoice: `deschashonly` added
* keysend: there's no "float" type, use "number" or "u32" etc.
* keysend: `routehints` is a valid arg, as is `extratlvs` (EXPERIMENTAL_FEATURES)
* listdatastore: `key` is not required.
* newaddr: `addresstype` can be "all"
* pay: `exemptfee` is "msat", new fields `locaofferid` and `exclude`
* sendonion: was mis-formatted, missed `localofferid` and `groupid` fields.
* sendpay: add `localofferid` and `groupid` params.
* signpsbt: add `signonly` param.
* txprepare "outptus" typo.
* waitsendpay: add `groupid` and  fix `partid` type.
* withdraw: `destination` is a bitcoin address, not a pubkey.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-02 09:46:01 +10:30
Rusty Russell dc924b8859 doc: set additionalProperties to false in all request schemas.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-02 09:46:01 +10:30
Rusty Russell 9784fa816f lightningd: deprecate invoice expiry suffixes.
Makes types harder, and I've never personally used them.

Changelog-Deprecated: JSON-RPC: `invoice` `expiry` no longer allowed to be a string with suffix, use an integer number of seconds.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-02 09:46:01 +10:30
Rusty Russell bf4d9e30d2 fundpsbt: deprecate reserve=true/false usage.
Make it always a number; this makes the JSON request specification
simpler.  We allowed a number since v0.10.1.

(reserve=True is the default anyway, so usually it can be omitted:
reserve=False becomes reserve=0).

Changelog-Deprecated: JSON-RPC: `fundpsbt`/`utxopsbt` `reserve` must be a number, not bool (for `true` use 72/don't specify, for `false` use 0).  Numbers have been allowed since v0.10.1.
2022-04-02 09:46:01 +10:30
Christian Decker bba68e2136 cln-grpc: Map AmountOrAll and AmountOrAny 2022-04-02 09:46:01 +10:30
Christian Decker 04e7e285d7 cln-rpc: Map PSBT and TX methods 2022-04-02 09:46:01 +10:30
Christian Decker 20704746bc grpc: Map `sendonion` and `createonion` 2022-04-02 09:46:01 +10:30
Christian Decker a7f3c54600 cln-rpc: Add invoice RPC methods 2022-04-02 09:46:01 +10:30
Christian Decker d90aafeed6 cln-grpc: Add the `connect` method 2022-04-02 09:46:01 +10:30
Rusty Russell 7f89763f9e sendpay: add payment_metadata argument.
And document the missing arguments.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-02 09:40:18 +10:30
Rusty Russell e01abf0b34 bolt11: support payment_metadata.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-02 09:40:18 +10:30
Rusty Russell 9f06a59e3c shutdown: don't allow shutdown to p2pkh or p2sh addresses for anchor outputs.
This doesn't have an effect now (except in experimental mode), but it
will when we support anchors.  So we deprecate the use of those in the
close command too.

For experimental mode we have to avoid using p2pkh; adapt that test.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Deprecated: JSON-RPC: `shutdown` no longer allows p2pkh or p2sh addresses.
2022-04-02 09:40:18 +10:30
Rusty Russell 2f7f7ec255 lightningd: add "style" to listforwards.
Suggested-by: @t-bast
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `listforwards` has new entry `style`, currently "legacy" or "tlv".
2022-03-31 19:38:05 +10:30
Rusty Russell 910d594214 doc: add partid to sendonion schema.
We never called this except from plugins, which didn't test schema.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-03-31 19:38:05 +10:30
Christian Decker 6098386182 cln-grpc: Add the `connect` method 2022-03-30 12:15:55 +10:30
Rusty Russell aad4495f56 delinvoice: allow desconly arg to only remove the description.
Means that field is now optional in JSON output.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `delinvoice` has a new parameter `desconly` to remove description.
2022-03-29 10:04:16 +10:30
Rusty Russell ccaf04d268 invoice: add deschashonly parameter.
LNURL wants this so they can include images etc in descriptions.

Replaces: #4892
Changelog-Added: JSON-RPC: `invoice` has a new parameter `deschashonly` to put hash of description in bolt11.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-03-29 10:04:16 +10:30
Rusty Russell 290dfd2b81 doc/schemas: handle delinvoice of paid invoice.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-03-29 10:04:16 +10:30
Sjors Provoost 560b090bd8 Add more warnings to fundchannel_start
[ Slight modifications to fix schema -- RR ]
2022-03-24 14:11:40 +10:30
Rusty Russell f7aba31448 lightningd: allow 'style' 'legacy' for clboss compat (with deprecated_apis).
We keep the parameter around for future use (e.g. PTLC support?), but clboss
master still sets 'style' to "legacy".  Accept, but ignore it.

Reported-by: grubman on #c-lightning (IRC)
Changelog-Deprecated: JSON-RPC: `sendpay` `route` argument `style` "legacy" (don't use it at all, we ignore it now and always use "tlv" anyway).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-03-24 13:19:10 +10:30
Rusty Russell 293cf3c2b2 connect: delay return until all subds ready.
We had some flakes because we returned from `connect`, but we hadn't started
subds yet.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-03-23 13:20:12 +10:30
Rusty Russell cb5dc48cab lightningd: make setchannelfee handle multiple channels per peer.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-03-23 13:20:12 +10:30
Rusty Russell 5704653d4c setchannel: don't let them advertize htlc_maximum_msat larger than capacity.
And check for the obvious setting min > max.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-03-22 18:45:41 +10:30
Rusty Russell 999c734bb5 setchannel: add minhtlc
Suggested by @m-schmook, I realized that if we append it later I'll
never get it right: I expect parameters min and max, not max and min!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Protocol: you can now alter the `htlc_minimum_msat` and `htlc_maximum_msat` your node advertizes.
2022-03-22 18:45:41 +10:30
Rusty Russell 42f91ff2fa lightningd: deprecate setchannelfee, use setchannel in tests.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Deprecated: JSON-RPC: `setchannelfee` (use `setchannel`).
2022-03-22 18:45:41 +10: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 33bd251296 listpeers: show maximum_htlc_out_msat.
This is htlc_maximum_msat in BOLT 7 speak, but this name matches our existing
fields and is clearer in this context.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-03-22 18:45:41 +10:30
Aaron Dewes 92fd97627d fix: Remove \ from help documentation 2022-03-20 08:42:20 +10:30
Jules Comte 8f0aab7061 doc: update ubuntu install instructions
Changelog-None
2022-03-18 13:09:37 +10:30
Rusty Russell 508b8cb54a doc: fix sendonionmessage documentation.
It's a low-level interface now, expecting you to build your own TLVs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reported-by: @valentinewallace
2022-03-16 11:24:42 +10:30
GoofyAF a2a6b8c3ff
Goofy af tor.md systemd syntax update (#5059)
Update TOR.md

Update tor install to represent current systemd syntax for enabling and starting a new system service
Corrected a typo. After tor is installed to refresh /etc/tor/torrc config changes the command should be 'sudo systemctl restart tor' not 'sudo systemctl start tor'
2022-03-13 10:30:11 +10:30
Michael Schmoock 9703ee05bf doc: update faq and docs for IP discovery 2022-03-12 16:35:09 +10:30
Vincenzo Palazzo 2c55c27ad4 doc: remove ambiguity for functionality enabled after a release version
Changelog-None: remove ambiguity for functionality enabled after a release version

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-03-10 10:24:34 +10:30
Christian Decker 4aba119733 pytest: Use valgrind target suppressions instead of skipping tests
Having a list of very targeted suppressions allows us to still run the
majority of tests with valgrind checking, and not fail when Rust does
some trickery. This is for example the case with `std::sync::Once`
which uses `num_procs` calling out to the cgroups subsystem, sometimes
with a null path.

Suggested-by: Rusty Russell <@rustyrussell>
2022-03-10 10:21:41 +10:30
Christian Decker 70840ef066 gci: Switch docs and CI builder to use `poetry` 2022-03-08 05:00:36 +10:30
niftynei b33868f7c2 coin_mvt: only chain moves have a blockheight
channel moves don't have blockheights
2022-03-05 15:12:12 +10:30
niftynei 590f12145b listpeers: include the `pushed_msat` amount
Useful for accounting for missed/historical channel opens, to figure out
what the actual sat contribution from each peer is at a utxo level

Changelog-Added: JSONRPC: `listpeers` now includes a `pushed_msat` value. For leased channels, is the total lease_fee.
2022-03-05 15:12:12 +10:30
niftynei 24a1c91045 coin_mvt: report the number of outputs on a channel close tx
The bookkeeper needs to know how many outputs to expect before we can
consider a channel resolved onchain.
2022-03-05 15:12:12 +10:30
Simon Vrouwe 2d06c38997 plugin-funder: fix typos in option lease-fee-base-msat and funder-fuzz-percent
Changelog-Experimental: option `--lease-fee-base-msat` renamed to `--lease-fee-base-sat`

Changelog-Experimental: option `--lease-fee-base-msat` deprecated and will be removed next release
2022-03-01 09:38:40 +10:30
Simon Vrouwe 0173717b6a doc: add details about: log-level, experimental options and `features` field returned by listnodes,
listchannels and connect.
2022-03-01 09:38:40 +10:30
Simon Vrouwe 905a85dc99 JSON-RPC: getinfo, add field `our_features`
All build flags and (experimental) options make it hard to find
out what features are supported or enabled.

And the undocumented `--list-features-only`, does not account for all
our featurebits, for example bit 55 (keysend).

Changelog-Added: JSON-RPC: `getinfo` result now includes `our_features` (bits) for various Bolt #9 contexts
2022-03-01 09:38:40 +10:30
Vincenzo Palazzo 11c94528b3 doc: reintroduce the fmt command to fmt the schema
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-02-22 09:48:16 +10:30
Christian Decker 3c32f7d8f6 json-rpc: Add request stubs for a couple of calls
These are required so we can generate the requests, not just the
responses. We'll add more as we test compatibility with our generation
code.
2022-02-11 16:02:25 +01:00
Aaron Dewes 0924b477b2 Remove useless \ 2022-02-10 12:05:44 +10:30
Aaron Dewes 74071c95a2 Remove some formatting inconsistencies
I've tried automatically parsing the docs, and these inconsistencies made it harder to do that.

(I tried to do that for a project which I can't share yet, I'm not sure if it'll even work).
2022-02-10 12:05:44 +10:30
Rusty Russell 849f92f4b0 doc/schemas: disallow unknown fields in listchannels.
Would have caught the previous bug!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-02-08 12:06:16 +01:00
Aaron Dewes c63d9e60f8 Add short_channel_id to listchannels.schema.json
This was previously marked as required, but not actually defined in properties.

[ Regenerated listchannels manpage -- RR ]
2022-02-08 12:06:16 +01:00
Tim W 1087f9aadd fix UnicodeDecodeError in doc/schemas/listfunds.schema.json 2022-02-07 14:00:12 +10:30
Tim W c4f882b875 fix UnicodeDecodeError in doc/lightning-listfunds.7.md 2022-02-07 14:00:12 +10:30
niftynei 8eecd6c9f9 doc: turns out these fields are optional 2022-02-07 13:02:09 +10:30
niftynei 081ef05dd1 listchannels: add funding_outnum to listchannels
Changelog-Added: JSONRPC: `listchannels` now includes the `funding_outnum`
2022-02-07 13:02:09 +10:30
niftynei 4dafeede5c coin moves: notify when we make deposits to external accounts
The blockheight is zero though, since these aren't included in a block
yet.

We also don't issue an 'external' deposit event if we can tell that the
address you're sending to actually belongs to our wallet (we'll issue a
deposit event when it gets included in a block)
2022-01-26 13:34:45 +10:30
niftynei 75df20ace9 doc nit: wrap rest of tags in backticks
Requested in a comment on a previous PR
2022-01-26 13:34:45 +10:30
niftynei ff4ae8b5f4 coin_moves: add an 'originating_account' field
If a coin move concerns an external account, it's really useful to know
which 'internal' account initiated the transfer.

We're about to add a notification for withdrawals, so we can use this to
track wallet pushes to outside addresses

Changelog-Added: JSONRPC: `coin_movement` to 'external' accounts now include an 'originating_account' field
2022-01-26 13:34:45 +10:30
niftynei 70a73928cb balance-snaps: add a `balance_snapshot` event; fires after first catchup
Fire off a snapshot of current account balances (node wallet + every
'active' channel) after we've caught up to the chain tip for the *first*
time (in other words, on start).
2021-12-28 04:42:42 +10:30
niftynei 5570c6da08 coin_moves: cleanup tags list, update docs, remove unused method
We don't use journal_entry any more; remove it and update all of the
remaining tags (plus docs)
2021-12-28 04:42:42 +10:30
niftynei 29c6718297 coin_mvt: record new 'fees' field on htlc channel moves
We record the amount of fees collected for a routed payment. For
simplicity's sake on the data agg side, we record the fee payment on
*BOTH* the incoming htlc and the outgoing htlc. Note that this results
in double counting if you add up the fees from both an in-routed and
out-routed payment.
2021-12-28 04:42:42 +10:30
niftynei b6463174d6 coin moves: turn 'tag' into 'tags' array, add OPENER tag
Channels that the node has hopened will now be tagged with 'opener' in a
list of tags.
2021-12-28 04:42:42 +10:30
niftynei d3d6c09758 coin_moves: update some info about 'blockheight' 2021-12-28 04:42:42 +10:30
niftynei 4506f639fa coin_moves: remove 'index' for moves; bump version
Get rid of the 'movement_idx', since we replay events now.

Since we're removing a field from the 'coin_movement' event emission, we
bump the version type.

Changelog-Updated: `coin_movements` events have been revamped and are now on version 2.
2021-12-28 04:42:42 +10:30
niftynei 737772f1ca coin-mvt: remove all the chain fees tracking
this will be impllicit going forward.
2021-12-28 04:42:42 +10:30
niftynei 9b1a0f9b7b coin-moves: remove penalty + chain fee types
FIXME: still has coin tracking stuff!
2021-12-28 04:42:42 +10:30
Dustin Dettmer 6cee603f71 Add pip requirements install to Mac instructions 2021-12-24 15:49:01 +01:00
Vincenzo Palazzo 5bbe3feee7 doc: document the errors code
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-12-15 12:24:54 +10:30
Vincenzo Palazzo 82124b7733 doc: force mistune==0.8.4 during pip package resolution.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Changelog-None: doc: force mistune==0.8.4 during pip package resolution.
2021-12-14 11:27:46 +10:30
Rusty Russell 405239e353 doc/Makefile: speed up schema check, only do on check-doc.
Don't do this on every build, it takes 4 seconds.  And split it
into individual targets, so make can parallelize (1.6 seconds here).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-12-14 09:37:52 +10:30
Jan Sarenik 4274080d81 doc: lightningd-config.5.md - default ports
Also nit: s/possible/possibly suggested by michaelfolkson.
2021-12-06 17:10:08 +10:30
Andrew Toth 5483465fb5 doc: add exclude arg doc for pay rpc 2021-12-04 21:37:42 +10:30
ZmnSCPxj jxPCSnmZ 80661f920b doc/lightning-datastore.7.md: Fix typos.
Changelog-None
2021-12-02 12:27:32 +00:00
Rusty Russell b3af5f5a2c spec: import latest onionmessage spec, based on routeblinding.
This is from 6e99c5feaf60cb797507d181fe583224309318e9

We renamed the enctlv field to encrypted_recipient_data in the spec, and the
new onion_message is message 513.  We don't handle it until the next patch.

Two renames:
1. blinding_seed -> blinding_point.
2. enctlv -> encrypted_recipient_data.

We don't do a compat cycle for our JSON APIs for these experimental
features only used by our own plugins, we just rename.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-12-01 05:44:28 +10:30
Rusty Russell b74848f6f6 common: remove support for pre v0.10.2 onionmessages.
Temporarily disable sendpay_blinding test which uses obsolete onionmsg;
there's still some debate on the PR about how blinded HTLCs will work.

Changelog-EXPERIMENTAL: onionmessage: removed support for v0.10.1 onion messages.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-12-01 05:44:28 +10:30
Simon Vrouwe a2a480e636 doc: update shutdown notification, changelog
Fixes: #4785
Fixes: #4883

Changelog-Changed: Plugins: `shutdown` notification is now send when lightningd is almost completely shutdown, RPC calls then fail with error code -5.
2021-11-30 13:34:44 +10:30
Michael Schmoock 01e8a523e9 bolt7: allow announcement of ADDR_TYPE_DNS 2021-11-30 09:38:17 +10:30
Vincenzo Palazzo 35c6f90666 doc: Fixed grammars and add jq as dev dependences.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-11-28 10:55:48 +10:30
Vincenzo Palazzo 9c45557959 doc: Fixed doc check with the last options
Changelog-None

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-11-28 10:55:48 +10:30
Vincenzo Palazzo ed80590fe1 doc: Document max-dust-htlc-exposure-msat the command line option
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-11-28 10:55:48 +10:30
Vincenzo Palazzo bd3c0ef85c jsonschema: Formatting json schema and regenerate docs
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-11-28 10:55:48 +10:30
Vincenzo Palazzo b933b2fa4d tools: add a tool to formatting schema, and fixed (hack) the Makefile code checking.
This include the following commits:

- review 1/2: move from tab to space, and remove the exp. prop from doc;
- review 2/2: remove experimental features;


Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-11-28 10:55:48 +10:30
Vincenzo Palazzo 38df2a3a4c ci: Introduce doc sanity check in Github action.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-11-28 10:55:48 +10:30
ZmnSCPxj jxPCSnmZ a9e261fc20 doc/PLUGINS.md: Clarify that `db_write` hook only works on SQLITE3.
I noticed that `wallet/db_postgres.c` never actually calls `db_changes_add`.

PostgreSQL arguably has a better replication system (a PostgreSQL cluster)
than what `db_write` hook can offer, so rather than make `db_write` work on
PostgreSQL, just document that it does not actually work there.

ChangeLog-none
2021-11-24 09:53:56 +00:00
ZmnSCPxj jxPCSnmZ 163d3a9203 doc/BACKUP.md: Discourage litestream use.
ChangeLog-None
2021-11-22 08:20:38 +00:00
ZmnSCPxj jxPCSnmZ a294683675 wallet/db_sqlite3.c: Support direct replication of SQLITE3 backends.
ChangeLog-Added: With the `sqlite3://` scheme for `--wallet` option, you can now specify a second file path for real-time database backup by separating it from the main file path with a `:` character.
2021-11-17 12:10:07 +10:30
Andrew Toth 1f951a5588 doc: update HACKING.md build dep instructions 2021-11-17 10:49:51 +10:30
Andrew Toth 3210213dc3 doc: add missing dev deps, upgrade and don't use sudo for pip 2021-11-17 10:49:51 +10:30
Rusty Russell 3dcab9793d doc/TOR.md: simplify, and don't cover autotor.
autotor is older, but statictor is better.  Your options are really
"use HiddenServiceDir in torrc" vs "use statictor", with the issue
that statictor requires you to configure Tor for control access by
c-lightning.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-11-14 18:49:46 +01:00
Rusty Russell 2a35f33cb0 doc/TOR.md: Make it clear that Tor == Torv3.
And switch ```` to ``` (emacs colorization was confused!).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-11-14 18:49:46 +01:00
Christian Decker d680e3b158 doc: Remove non-ASCII character from docs
mrkd doesn't like non-ASCII characters in ubuntu:18.04, used for
repro-builds. This is the easiest way to sidestep this issue until we
deprecate the old ubuntu version.
2021-10-31 16:57:56 +01:00
niftynei 1fe829c546 lightningd: new option for htlc dust limit
To reduce the surface area of amount of a channel balance that can be
eaten up as htlc dust, we introduce a new config
'--max-dust-htlc-exposure-msat', which sets the max amount that any
channel's balance can be added as dust

Changelog-Added: config: new option --max-dust-htlc-exposure-msat, which limits the total amount of sats to be allowed as dust on a channel
2021-10-23 12:59:13 +02:00
Christian Decker 0f0a77e322 doc: Add M1 mac + homebrew fix
The paths for this platform seem to be slightly different, so mention
how they must be set.
2021-10-22 16:05:23 +02:00
Rusty Russell ed6eaf9171 experimental-websocket-port: option to create a WebSocket port.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-10-22 11:56:30 +02:00
Rusty Russell b013b3ab0c patch websocket-address-support.patch 2021-10-22 11:56:30 +02:00
ZmnSCPxj jxPCSnmZ 3e902e2816 doc/BACKUP.md: Warn about version if using Litestream, `sqlite3` `.dump` is safe(r) now. 2021-10-17 23:58:39 +00:00
Christian Decker 511cb14fbe doc: Add missing `amount_sent_msat` to `listpays` 2021-10-13 13:41:18 +10:30
Christian Decker a9eb7b427f jsonrpc: Add missing `partid` in `listsendpays` schema 2021-10-13 13:41:18 +10:30
Christian Decker a1f509e4b5 jsonrpc: Add groupid to `sendpay` and `sendonion`
Also add `groupid` to the payment fields so we can retrieve them too.
2021-10-13 13:41:18 +10:30
Rusty Russell be3eaa475c doc: update ungenerated file.
Commit c92ce59892 somehow missed this.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-10-11 10:41:50 +02:00
Rusty Russell c9b82bf1d2 channeld: restore ping command, but only for channeld.
It's probably not worth fixing for the other daemons.

Changelog-Changed: JSON-RPC: `ping` now only works if we have a channel with the peer.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-10-10 15:32:57 +02:00
Rusty Russell c92ce59892 BOLT 12: switch invoice_request/invoice to singular `chain` field.
We keep the now-removed chains field, and in deprecated mode, we set it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: bolt12: `chains` in invoice_request and invoice is deprecated, `chain` is used instead.
2021-10-08 13:47:30 +02:00
Rusty Russell 45bf7a3974 bolt12: update to latest spec.
Main changes are:
1. Uses point32 instead of pubkey32.
2. Uses issuer instead of vendor.
3. Uses byte instead of u8.
4. blinded_path num_hops is now a byte, not u16 (we don't use that yet!).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: bolt12: `vendor` is deprecated: the field is now called `issuer`.
2021-10-08 13:47:30 +02:00
Rusty Russell 8f582e770c BOLT12: use point32 instead of pubkey32.
That's the modern BOLT12 term.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-10-08 13:47:30 +02:00
Rusty Russell f9a21d9fc9 lightningd: handle modern onion termination.
This adds a new hook: onion_message_ourpath for when we know a message
came in via a blinded path we created.  The onion_message_blinded hook
is now called for all other messages, since all messages are now
blinded.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-10-04 11:58:31 +02:00
jerzybrzoska d54594c3dc Correcting typo 2021-10-02 14:02:55 +02:00
Christian Decker ec75090890 doc: Add the in-tree-build option to install docs
This is required for the setuptools_scm package to correctly identify
the root of the git repository when installing from the
requirements.txt file in the root. It'd otherwise copy the source
directory, which doesn't yet include the version metadata, into a
separate directory and the building from there, which breaks the
git lookup.

`in-tree-build` is the future default, so we'll eventually be able to
strip that option again. See [1] for details.

[1] https://github.com/pypa/pip/issues/7555
2021-09-28 18:34:43 +02:00
Rusty Russell 33168fc733 lightningd: provide 10 minutes for channel fee increases to propagate.
This was measured as a 95th percentile in our rough testing, thanks to
all the volunteers who monitored my channels.

Fixes: #4761
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `setchannelfee` gives a grace period (`enforcedelay`) before rejecting old-fee payments: default 10 minutes.
2021-09-23 15:05:09 +02:00
Rusty Russell 79e09b92ef Makefile: remove generated files.
By popular merge-hell demand.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: Build: Python is now required to build, as generated files are no longer checked into the repository.
2021-09-22 15:25:14 +02:00
Rusty Russell 3dbf3b057a Makefile: remove NO_PYTHON flag in anticipation of making it compulsory.
And note the EXPERIMENTAL_DUAL_FUND env var in HACKING.md.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-09-22 15:25:14 +02:00
Vincenzo Palazzo eb103c15df review 2/2: Use generic query to make the code more readable.
Suggested by @cdecker

P.S: Also this include an API refactoring from my previous solution, also this it is suggested by @cdecker.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-09-22 16:23:24 +09:30
Vincenzo Palazzo bea6ea27e8 review 1/2: Fixed the doc missing details about formatting.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-09-22 16:23:24 +09:30
Vincenzo Palazzo 9d5c992fc8 plugin: Adding status to the pay plugin
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>

Rebase

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-09-22 16:23:24 +09:30
Vincenzo Palazzo 62ef403d20 doc: Update doc with the new parameter supported
Changelog-Added: Support to listpays the status parameter to filter the payments by status.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-09-22 16:23:24 +09:30
Christian Decker 39b71ef4a1 doc: Add links to mandelbit's recovery walkthrough 2021-09-22 09:08:48 +09:30
Rusty Russell 84957be410 close: spec is final, it's not experimental.
That was quick!

We remove the 50% test, since the default is now to use quickclose.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Protocol: We now perform quick-close if the peer supports it.
2021-09-09 12:04:48 +09:30
Rusty Russell 6ee8c40b29 closing: add option to set closing range.
This affects the range we offer even without quick-close, but it's
more critical for quick-close.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSONRPC: `close` now takes a `feerange` parameter to set min/max fee rates for mutual close.
2021-09-09 12:04:48 +09:30
Rusty Russell 79d7e83f51 --experimental-quick-close to enable quick-close negotiation
Based on a commit by @niftynei, but:
- Separated quickclose logic from main loop.
- I made it indep of anchor_outputs, use and option instead.
- Disable if they've specified how to negotiate.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-09-09 12:04:48 +09:30
Rusty Russell 36baef22e2 doc: document shutdown plugin.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-09-05 15:16:56 +02:00
Rusty Russell 6d1897b796 doc: fix GH/readthedocs rendering of manual pages.
They render the comment as if it's in the list.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-09-05 15:02:17 +02:00
William Casarin 105a88dde4 docs/fetchinvoice: document payer_note
Signed-off-by: William Casarin <jb55@jb55.com>
2021-09-04 13:18:29 +02:00
Michael Schmoock 37a7dab549 doc: new values for commitment_revocation hook 2021-09-04 11:54:33 +09:30
Christian Decker 7e43109e33 doc: Regenerated man-pages to fix hash mismatch. 2021-09-03 20:03:02 +09:30
Rusty Russell 1c8294ef1c doc: fix listnodes schema, doc.
Shows the dangers of "additionalProperties": true.  We didn't have an else
clause, so our incorrect (and, with DF, incomplete!) schema was accepted.

I despair of getting anyone else to write a decent schema with these
semantics :(

Changelog-Fixed: doc: listnodes fields now correctly documented.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-09-03 20:03:02 +09:30
Christian Decker df70bbcc6a docs: Remove explicit markdown configuration for rtd 2021-08-31 11:46:17 -05:00
Alex c066378576 added Litestream Replication
Litestream enables easy SQLite replication
2021-08-26 12:44:02 +09:30
Rusty Russell fe86c117d9 datastore: turn keys into arrays
After some discussion with @shesek, and my own usage, we agreed that
a more comprehensive interface, which explicitly supports grouping,
is desirable.

Thus keys are now arrays, with the semantic that a key is either a
parent or has a value, never both.

For convenience in the JSON schema, we always return them as arrays,
though we accept simple strings as arguments.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-25 10:06:31 +02:00
Rusty Russell 533571a655 datastore: add generation, simple atomicity.
We add a generation counter, and allow update or del conditional
on a given generation.

Formalizes error codes, too, since we have more now.

Suggested-by: @shesek
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-25 10:06:31 +02:00
Rusty Russell 432508e65e datastore: allow replace/append.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-25 10:06:31 +02:00
Rusty Russell e711f6c589 datastore: allow strings.
It's common, and the simplest case.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-25 10:06:31 +02:00
Rusty Russell dfe2693bbd datastore: docs, schemas, and a test.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-25 10:06:31 +02:00
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
LightningHelper 720a4d7ae7 exact bk file has to be in path
The exact file that will be the backup has to be in the backup output path.
2021-08-25 11:58:56 +09:30
LightningHelper 1b705f0cc9 missing --lightning-dir
It seems that the plugin require `--lightning-dir` , using without `--lightning-dir` result with an error.
2021-08-25 11:58:56 +09:30
Michael Schmoock 24ea498350 cleanup: rename use_proxy_always to always_use_proxy to match cfg
This renames all occurences of use_proxy_always to always_use_proxy
to keep it inline with config values. This was a bit confusing.

Only significant change is that the payload in the plugins init
requests also contained the old name. No plugin currently seems to make
use of this variable yet. The old name 'use_proxy_always' is added when
deprecated APIs is enabled.

Changelog-Deprecated: Plugins: Renames plugin init 'use_proxy_always' to 'always_use_proxy'
2021-08-23 14:43:40 +09:30
LightningHelper 76edaac1a9 new line for default value, makes it more visable
See here #4670
2021-08-09 20:10:49 -05:00
niftynei 88f8e63ab6 funder-rbf: correctly iniitalize lease params
We weren't initializing lease params, which was leading to undefined
behavior for rbfs
2021-08-09 07:11:05 +09:30
Rusty Russell a8b3a1c29c offers: make `decode` command available even without experimental-offers.
It subsumes `decodepay`, and it's nicer if people can just assume it's
available at all times.

Changelog-Added: JSON-RPC: `decode` now available without `experimental-offers`
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-02 13:23:31 -04:00
Rusty Russell 59e94dab4b doc/MAKING-RELEASES.md: advice on updating python package versions.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-07-30 19:17:47 +02:00
LightningHelper a5d65c00c6 diff -R to diff -r
diff does not have -R, it has -r
2021-07-24 09:11:45 +09:30
Rusty Russell ceb40dea38 lightningd: don't turn zero-length tlv fields into NULL.
Fixes: #4667
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-07-21 13:27:27 -04:00
Rusty Russell cb9e0268a7 offer / offerout: return existing if its still active.
As requested by @shesek: it's weird to fail if they ask for the exact
same thing (which is quite possible, since offers don't expire by
default).

And add a new "created" field so they can tell if they have an old
one.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-07-21 13:27:27 -04:00
Rusty Russell 44c469d52b disableoffer: fix disabling of already-used offers.
Turns out we didn't actually test this at all, and next commit does :(

    offer_status_in_db: 4 is invalid
    lightningd: FATAL SIGNAL 6 (version v0.10.0-459-g48fbd45-modded)
    0x5608cd360855 send_backtrace
	common/daemon.c:39
    0x5608cd3608ff crashdump
	common/daemon.c:52
    0x7f9af1dae20f ???
	???:0
    0x7f9af1dae18b ???
	???:0
    0x7f9af1d8d858 ???
	???:0
    0x5608cd30a47e fatal
	lightningd/log.c:819
    0x5608cd3430c5 offer_status_in_db
	wallet/wallet.h:1424
    0x5608cd34f1f3 wallet_offer_disable
	wallet/wallet.c:4494
    0x5608cd33ae2e json_disableoffer
	lightningd/offer.c:256
    0x5608cd3038fc command_exec
	lightningd/jsonrpc.c:643

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-07-21 13:27:27 -04:00
Rusty Russell 7769903f1a bolt12: import latest spec (timestamp -> created_at).
@shesek points out that we called this field created_at in bolt11 decode,
which makes more sense anyway.

Changelog-EXPERIMENTAL: bolt12 decode `timestamp` field deprecated in favor of new name `created_at`.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-07-21 13:27:27 -04: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 f24bbac8d9 channel leases: pass expected lease rates around in compat form
We need to know what the lease we're expecting is. To do this
we pass around the hex encoded portion of the wire format.

We can use this passed in expected lease rates to confirm that the peer
is, in fact, using the same rates as what we have currently.

Changelog-Added: JSON-RPC: fundchannel, multifundchannel, and openchannel_init now accept a 'compact_lease' for any requested funds
2021-07-20 13:28:38 -04:00
niftynei f3b54a510b close: param to force-close a leased channel
By default, we won't close a channel that we leased to a peer.
You can override this with the `force_lease_closed` flag.

Changelog-Added: JSON-RPC: close now has parameter to force close a leased channel (option_will_fund)
2021-07-20 13:28:38 -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 9ad40f2544 liquidity-ad: pipe `request_amt` all the way out to fundchannel
Changelog-Added: JSON-RPC: `fundchannel` now takes optional `request_amt` parameter
2021-07-20 13:28:38 -04:00
niftynei e41d2dc0e6 liquidity-ad: request amount, pass through to dualopend
Changelog-Experimental: EXPERIMENTAL-DUAL-FUND: JSON-RPC: openchannel_init now takes a `requested_amt`, which is an amount to request from peer
2021-07-20 13:28:38 -04:00
niftynei f1b7e5fffe liquidity-ads: pipe through request to funder, update policy
When a request comes through, we forward it over to the funder who
uses the currently set policy to figure out how to handle it.

Includes small update to the policy engine which decides whether or not
to fund a request.

Changelog-Experimental: Plugins: `openchannel2` hook now includes optional fields for a channel lease request
2021-07-20 13:28:38 -04:00
niftynei 376e6f8bd1 dual-funding: update fee_step to be a feerate
Using a 'feestep' is more restrictive than you'd want, instead we
enforce that the next feerate must be at least 1/64th more than the
last, but put no upper limit on it

Includes update to lnprototest changes

Contributed-By: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Changelog-EXPERIMENTAL: Protocol: Replaces init_rbf's `fee_step` for RBF of v2 opens with `funding_feerate_perkw`, breaking change
2021-07-19 16:13:24 -04:00
nathanael 3e10099725 docs: fix typo and wording
changelog-none
2021-07-19 12:49:08 +09:30
LightningHelper 3ec2167590 improve hsm_secret doc 2021-07-19 12:45:44 +09:30
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
Rusty Russell 3f5d5a1de5 invoice: output payment_secret in JSON.
This makes it easier to access (rather than decoding bolt11).

Changelog-Added: JSON-RPC: `invoice` now outputs explicit `payment_secret` it its own field.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-07-14 14:38:00 -05:00
Michael Schmoock 0f5aab2b3c doc: listchannels filter by destination 2021-07-14 14:34:00 -05:00
niftynei 1d5a00e547 schema: fixup for dual-funding things 2021-07-11 10:41:08 +09:30
niftynei e733e3210e schema: add 'funding_outnum' to openchannel_update schema 2021-07-11 10:41:08 +09:30
Rusty Russell adab9eb301 lightningd: add force-feerates option.
Useful for regtest and testnet.  Sure, you shouldn't use this on mainnet,
but I haven't restricted it because our users are usually pretty clever.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fixes: #1806
Changelog-Added: config: `force_feerates` option to allow overriding feerate estimates (mainly for regtest).
2021-07-09 07:26:09 +09:30
Rusty Russell 063366ed7e listinvoices: support listing by local offer_id.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-07-03 12:13:45 +09:30
Rusty Russell 2cb16a65c4 invoices: display the payer note if it's for local offer, allow in fetchinvoice.
We don't do it for sendinvoice (yet?).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: `fetchinvoice` can take a payer note, and `listinvoice` will show the payer_notes received.
2021-07-03 12:13:45 +09:30
Rusty Russell f9fe814ea3 offers: signatures are now optional.
As per latest spec revision.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: BOLT12 offers can now be unsigned, for really short QR codes.
2021-07-03 12:13:45 +09:30
Rusty Russell c974fbf0f1 fetchinvoice: try to connect to note if we can't find a path for messages.
This also adds a `fetchinvoice-noconnect` option to suppress it too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: `fetchinvoice` and `sendinvoice` will connect directly if they can't find an onionmessage route.
Fixes: #4624
2021-07-03 12:13:45 +09:30
Rusty Russell 33a40ca73b listinvoice: populate local_offer_id when iterating whole db.
And add the local_offer_id to the schemas too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: JSONRPC: `listoffers` now shows `local_offer_id` when listing all offers.
2021-07-03 12:13:45 +09:30
nathanael a8d2336ab9 doc: fix
lightning-config(5) -> lightningd-config(5)
< <email> > -> <<email>> in markdown files
2021-06-30 09:43:23 +09:30
Rusty Russell 408342dc23 doc: schema for listconfigs, compare with documentation.
This made me document what are options are now in plugins, too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-06-25 09:49:33 +09:30
Rusty Russell 2ddecdc95a doc: schemas for everything else.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: doc: Epic documentation rewrite: each now lists complete and accurate JSON output, tested against testsuite.
2021-06-25 09:49:33 +09:30
Rusty Russell 977cb62e12 doc: listpeers schema.
This is the most complex one.  It gets its own commit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-06-25 09:49:33 +09:30
Rusty Russell 6e636a835f tools/fromschema.py: handle deprecated null field, don't create empty lists.
1. listpeers has a deprecated `"closer": null`, which we need
   to handle in the schema, while trying not to damage our
   documentation too much.

2. Don't print a condition if there are no fields to print.

3. Allow a special "untyped" marker for multifundchannel which returns
   arbitrary JSON in a field.

4. Allow a single field return (for 'stop').

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-06-25 09:49:33 +09:30
Rusty Russell 1a181a3240 doc/schemas: listfunds, listinvoices, listnodes, listoffers
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-06-25 09:49:33 +09:30
Rusty Russell 2296d4452f doc/schemas: listfunds
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-06-25 09:49:33 +09:30
Rusty Russell 74eeaa8213 doc/schemas: getsharedsecret, help, invoice, listchannels, listforwards
And a new "u8" type.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-06-25 09:49:33 +09:30
Rusty Russell a9f49b5326 doc: document how to try to write JSON schemas.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-06-25 09:49:33 +09:30
Rusty Russell fe161ff962 doc/schemas: tighten requirements.
If we have conditional fields, we often set `additionalProperties` `true`
at the top-level, but then we have to make sure to cover all the possible
combinations in conditionals, so unintended additions don't appear.

This revealed missing fields in delinvoice, for example.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-06-25 09:49:33 +09:30
nathanael 262f90d115 replace freenode with libera
Changelog-None
2021-06-21 12:42:09 +09:30
Rusty Russell cda8f8190b invoice: overhaul routehints to use topology.listincoming, cleanup.
This turned into a more extensive cleanup than intended.  The previous
warnings were overlapping and confusing, especially now MPP is the norm.

*warning_capacity* is now the "even under best circumstances, we don't
have enough incoming capacity", which is really what
warning_mpp_capacity was trying to say (no longer printed).

*warning_offline* and *warning_deadends* are only given if adding such
peers would have helped give capacity (i.e. not if *warning_capacity*
is set).  The new *warning_private_unused* tells you that we would
have sufficient capacity, but we refused to expose private channels.

The test cases have been enhanced to cover the new warnings.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `invoice` now gives `warning_private_unused` if unused unannounced channels could have provided sufficient capacity.
Changelog-Changed: JSON-RPC: `invoice` warnings are now better defined, and `warning_mpp_capacity` is no longer included (since `warning_capacity` covers that).
2021-06-16 10:29:17 +09:30
Rusty Russell 064ad486e3 close: check that destination is going to be accepted.
Prior to this, sending a v1 address (or, in fact, any random crap!)
would cause the unsupporting node to unilaterally close.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-06-11 13:54:20 +09:30
fiatjaf 28953256d0
stop requiring channel and direction on `sendonion` since they're not used.
Changelog-Changed: `sendonion` no longer requires the gratuitous `direction` and `channel` fields in the `firsthop` parameter.
2021-06-04 10:48:10 +09:30
Rusty Russell 0b01a8c76f doc: document ordering of listpays/listsendpays.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-06-01 11:14:38 -05:00
Rusty Russell ec83d7a8a5 doc/schemas: disableoffer, disconnect, feerates, fetchinvoice, fundchannel, fundchannel_cancel, fundchannel_complete, fundchannel_start, fundpsbt, getinfo, getlog, getroute.
We also add a test for getlog, since it was never called by the
testsuite.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-05-27 20:28:49 +09:30
Rusty Russell fbc2672074 doc/schemas: delexpiredinvoice, delinvoice, delpay.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-05-27 20:28:49 +09:30
Rusty Russell d1b42cccd1 doc/schemas: decode, decodepay
One of the more complex ones.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-05-27 20:28:49 +09:30
Rusty Russell 4b46190cc4 doc/schemas: schema for connect.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-05-27 20:28:49 +09:30
Rusty Russell 5d7203ed6b doc/schemas: create close schema.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-05-27 20:28:49 +09:30
Rusty Russell 0b48dd79ac doc/schemas: add schema for autoclean.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-05-27 20:28:49 +09:30
Rusty Russell 3bc5d47aa2 doc/schemas: add some simple schemas and generate manpages from them
addgossip, check, createinvoice, createonion.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-05-27 20:28:49 +09:30
Rusty Russell fdb4953fa9 doc/schemas: generate manpage section from schema.
We start with the listpays manpage.  Which is now complete!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-05-27 20:28:49 +09:30
Rusty Russell ea99a05249 pytest: add schema support for JSON responses.
This adds our first (basic) schema, and sews support into pyln-testing
so it will load schemas for any method for doc/schemas/{method}.schema.json.

All JSON responses in a test run are checked against the schema (if any).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-05-27 20:28:49 +09:30
Rusty Russell ebe8f37400 doc: fix up mangled nroff from mkrd.
Nested lists don't work (it puts the .RS at the end of the line
instead of on a line by itself), so we sed it.

	https://github.com/refi64/mrkd/issues/4

This fixes up formatting on a number of existing pages..

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-05-27 20:28:49 +09:30
Rusty Russell bca8427317 Makefile: allow postfixes to SHA256STAMP.
For markdown, there's no simple comment prefix: we need a postfix too.
We also need to use "" since we want to use ' in some of the Makefiles
in future when V=1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-05-27 20:28:49 +09:30
Rusty Russell efe29c9db8 sendpsbt, fundpsbt, utxopsbt, reserveinputs, unreserveinputs: allow custom number of blocks to reserve.
Not an API break: reserve=true|false still works for fundpsbt and utxopsbt,
but we also allow a raw number in there.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-05-26 15:08:01 +09:30
Rusty Russell f24dc9173d wallet: add "reserved_to_block" field to listfunds.
We already have this field in reserveinputs and unreserveinputs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `listfunds` has a new `reserved_to_block` field.
2021-05-26 15:08:01 +09:30
urza 5aed2bc212 This should hopefully alleviate the pain of figuring out how to properly quote utxos in fundchannel command :) It took me a while to figure it out and I would be lost without @cdecker s help on IRC.
Changelog-None: Docs change only
2021-05-25 15:19:11 -05:00
Antoine Poinsot 9a363c6f9e doc/TOR: remove references to deprecated v2 hidden services
The doc is really confusing and would probably need a refactor, i did my
best to remove references to v2 services without losing any meaning...

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2021-05-24 20:22:45 +09:30
Antoine Poinsot e6527ccece options: deprecate v2 mode for autotor
Changelog-Deprecated: Changelog-Deprecated: lightningd: `enable-autotor-v2-mode` option.  Use v3.  See https://blog.torproject.org/v2-deprecation-timeline.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2021-05-24 20:22:45 +09:30
fiatjaf 64199d99fd "createonion" to accept an optional custom onion_size.
Changelog-Added: `createonion` RPC command now accepts an optional `onion_size`.
2021-05-24 12:52:19 +02:00
Dave Scotese f798fb1dd6 Clearer RETURN VALUE
When I read the RETURN VALUE the first time, I didn't realize this command produces (or recreates) the psbt that I need.  The change I made makes that more obvious when it's presented as a hit by GH for a search for psbt.

[ Generated man page --RR ]
2021-05-24 13:45:10 +09:30
Dave Scotese cb7e7b293f added FAQ on getting a PSBT
It may also be appropriate to update the description of utxopsbt so that the search hits for "psbt" here on github make it clearer that utxopsbt returns what you're seeking.  I'll make that part of this pull request too.
2021-05-24 13:45:10 +09:30
Rusty Russell cc6f1fd120 update-mocks: don't try to regenerate files.
If you do update-mocks in a dirty tree, the recursive make that it
uses will try to rebuild things!  Suppress that.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-05-22 17:53:04 +09:30
niftynei 7a488cc11e df-tests: remove df_accepter plugin
The `funder` plugin, does the same stuff as this temporary test plugin,
so we move over to using that instead.
2021-05-12 11:25:41 +09:30
Rusty Russell 9825f32874 lightningd: implement --log-timestamps=false.
Fixes: #4494
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: config: New option `log-timestamps` allow disabling of timestamp prefix in logs.
2021-05-05 17:19:19 -05:00
Christian Decker c58b15de19 docs: Document the custom plugin notifications 2021-05-03 11:20:15 +09:30
niftynei a293bf3269 rbf_channel hook: add channel_max_msat parameter
Changelog-Added: Plugins: `rbf_channel` hook has `channel_max_msat` parameter
2021-05-03 11:06:10 +09:30
niftynei 7c76363e20 openchannel2: add channel_max_msat to openchannel2 hook payload
Changelog-Added: Plugins: add a `channel_max_msat` value to the `openchannel2` hook. Tells you the total max funding this channel is allowed to have.
2021-05-03 11:06:10 +09:30
Christian Decker 0060dc733c docs: Add documentation of --experimental-dual-fund option 2021-04-24 13:58:57 +09:30
Rusty Russell d211e1ff1c devtools: add experimental section.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-04-07 14:34:39 +09:30
Rusty Russell 162ba9d162 close: activate notifications even with deprecated-apis.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: JSON-RPC: `close` now always returns notifications on delays.
2021-04-07 14:34:39 +09:30
Rusty Russell b0d6996ed6 lightningd: get connection direction from connectd.
This matters: if we connected, the address is probably usable for future connections.
But if they connected, the port is probably not (but the IP address may be).

Changelog-Added: JSON-RPC: `connect` returns "direction" ("in": they iniatated, or "out": we initiated)
Changelog-Added: plugins: `peer_connected` hook and `connect` notifications have "direction" field.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-03-26 13:22:33 +10:30
Christian Decker 777f0b1145 doc: Remove leftover conflict marker in the docs 2021-03-22 12:33:16 +10:30
Rusty Russell 6c9d9ee9a2 connect: return address we actually connected to.
Otherwise, we might find an address other than the one given and
the user might think that address worked.

Fixes: #4185
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `connect` returns `address` it actually connected to
2021-03-17 08:38:08 +10:30
Rusty Russell 43a553f5ac txprepare, withdraw: return the PSBT as well as raw tx.
In particular, txprepare gives us a nice way to get a valid PSBT for
testing.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `txprepare` and `withdraw` now return a `psbt` field.
2021-03-16 13:10:07 +10:30
Rusty Russell da7ba6c146 lightningd/opening_control: allow single-arg fundchannel_complete with PSBT
Requiring the user to calculate the txid of the PSBT is a horrible, bad,
no-good idea.

Doesn't deprecate yet, so I can test that this path works while
multifundchannel still uses it.

Fixes: #4416 (at least for future users!)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `fundchannel_complete` takes a psbt parameter.
2021-03-16 13:10:07 +10:30
Rusty Russell b62706aa01 close: accept wrong_funding outpoint arg if we negotiated the feature.
Changelog-Added: lightningd: experimental-shutdown-wrong-funding to allow remote nodes to close incorrectly opened channels.
Changelog-Added: JSON-RPC: close has a new `wrong_funding` option to try to close out unused channels where we messed up the funding tx.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-03-16 13:08:40 +10:30
Rusty Russell cc6d2afe21 Experimental option option_shutdown_wrong_funding: help me, I screwed up!
It's not unheard of for people to give the wrong funding tx to us,
getting their funds stuck.  Interestingly, we can allow mutual close
using a different txid and output number as long as they (solely)
funded the channel, and the channel hasn't been used.

This defines a "play area" feature to do just that.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-03-16 13:08:40 +10:30
Jan Sarenik 1b02d15695 typo: information is an uncountable mass noun
See https://en.wikipedia.org/wiki/Information

In libplugin.c also the word "details" was added (without removing
the 'information').

Changelog-None
2021-03-16 10:45:40 +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 8182e9cea4 df: update the openchannel2 parameter 'accepter' -> 'our'
The `rbf_channel` hook uses `our_funding_msat`, which is a nicer
and more easily understood than the `openchannel2`
`accepter_funding_msat`.

This updates the `openchannel2` hook to use the same nomenclature as
`rbf_channel`.
2021-03-12 14:00:19 +10:30
niftynei 49691fa732 docs: add notes on v2 openchannel plugin hooks 2021-03-12 14:00:19 +10:30
niftynei c476f366fd nit: change spacing on PLUGIN doc 2021-03-12 14:00:19 +10:30
niftynei 52b5dbb01d df: add doc for `channel_open_failed` notification
When a channel fails, send out a notification.

We were missing this notification in one case, which has been added.
2021-03-12 14:00:19 +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
niftynei a648ec827a df-doc: update error codes, make sure they're correct 2021-03-12 14:00:19 +10:30
Rusty Russell 0d581ddc01 CHANGELOG: add title and namer to last release.
devtools/credits relies on this to choose the next namer.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-03-12 12:45:25 +10:30
Rusty Russell 4dcd4ca155 listpeers: add latest feerate and actual last fee amount.
Users have no idea what they would pay for unilateral closes.
At least this gives them a clue!

Reported-by: @az0re on IRC.

Changelog-Added: JSON-RPC: `listpeers` now shows latest feerate and unilaral close fee.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-03-05 13:12:41 +10:30
Karol Hosiawa bb48de447d Updated listforwards doc with new parameters
Changelog-Added: JSON-RPC: `listforwards` can now filter by status, in and out channel.
2021-03-03 09:19:20 +10:30
Michael Schmoock 316457a1de doc: make rpc_command hook chainable 2021-03-03 09:18:53 +10:30
Christian Decker ebb1b19c65 plugin: Fix the custommsg hook not to include the internal prefix
We were always prefixing the `message` field with the internal type
prefix 0x0407, followed by the length prefix. Neither is needed since
the type being constant is of no interest to the plugin and the length
being implicit due to the JSON-encoding.

Reported-by: Ilya Evdokimov
Changelog-Fixed: plugin: The `custommsg` hook no longer includes the internal type prefix and length prefix in its `payload`
Changelog-Deprecated: plugin: The `message` field on the `custommsg` hook is deprecated in favor of the `payload` field, which skips the internal prefix.
2021-03-02 14:41:16 +10:30
Christian Decker 46d00962b4 doc: Fix minor markup issues in the newaddr manpage 2021-03-02 11:56:59 +10:30
Matthias Debernardini c301abe602 Minor wording 2021-02-25 14:35:57 -06:00
Rusty Russell 874ca99c32 offers: make 'used' flag more useful.
We used to only set it for single-use offers (where it's required),
but it's still interesting for multi-use offers, so let's keep it
there.

We also put this field in the documentation.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-02-25 14:44:03 +10:30
Rusty Russell 960ef95b23 doc: add mpp warnings to lightning-invoice(7)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-02-25 14:44:03 +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 4b637ef716 doc: fix up incorrect punctuation in lightning-fundchannel page.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-02-25 14:44:03 +10:30
Luke Childs dc38e65ed3 Fix typo in doc/BACKUP.md 2021-02-22 13:01:56 +10:30
Christian Decker 8818645316 Regenerate derived files 2021-02-11 09:48:55 +01:00
keblek ce6da69cc3 Regtest does not exist to the CLI 2021-02-08 14:46:50 +01:00
keblek 50771b5e76 Added regtest, example, k and null explanation
network was missing regtest as an option. 

The example was too simple, so I added a second one so show how the k option works.

The explanation of how k works should let the user know that in some cases lightningd will interpret the position of an argument which can lead to a weird response from lightningd.

let the users know that using null is not encouraged

@cdecker said "I think we should definitely not encourage null, since that is very brittle and forces us to keep argument ordering, and deprecating arguments is practically impossible."
2021-02-08 14:46:50 +01:00
Christian Decker d134580419 doc: Update the recommonmark extension for RTD compilation 2021-02-07 17:34:25 +01:00
niftynei ea95ad9c12 fund/utxopsbt: flag 'excess_as_change' to add a change output for excess
In the case where you want a PSBT and also want the output to be added
as a change address, use `excess_as_change` = true.

Generates a change address to use. If you want to pay the excess
elsewhere, you will have to add separately.

Changelog-Added: JSON-RPC: Add new parameter `excess_as_change` to fundpsbt+utxopsbt
2021-02-04 13:25:34 -06:00
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 0056dd7557 lightningd: disallow --daemon without --log-file.
From #clightning:

    (11:24:10) andytoshi: hiya, i'm trying to set up a new lightningd node, and when i run lightningd --network=bitcoin --log-level=debug --daemon
    (11:24:17) andytoshi: i get errors of the form fetchinvoice: Malformed JSON reply '2021-01-25T00:51:16.655Z DEBUG   plugin-offers: disabled itself at init: offers not enabled in config
    (11:24:43) andytoshi: there are a couple variants of this, but always some form of "something: failed to parse <a log line> as json"

Indeed, we close stdout, and it ends up being reused for some plugin.
But the real problem is that we log to stdout by default, which doesn't
make sense.  If they really want to discard logs, they can use
--log-file=/dev/null.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: JSON failures when --daemon is used without --log-file.
2021-02-01 09:57:54 +10:30
Michael Schmoock 54675546ab doc: openchannel note close_to can only be set once 2021-02-01 09:57:15 +10:30
Michael Schmoock 7106349eab doc: document peer_connected hook chainable 2021-02-01 09:57:15 +10:30
Michael Schmoock 4e8d3f395b doc: document custommsg hook now chainable 2021-01-29 13:37:42 +10:30
Christian Decker 527cae0d4c doc: Make the release process a bit more readable 2021-01-26 15:45:13 +01:00
Christian Decker 25a7bf6aa3 doc: Update release process document 2021-01-26 15:45:13 +01:00
Rusty Russell 130280d457 doc/PLUGINS.md: Document the onion_message and onion_message_blinded hooks.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-01-14 13:56:13 +01:00
Rusty Russell 424800fba6 doc: note where experimental-offers is required or affects commands.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-01-14 13:56:13 +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 529ae0d766 plugins: allow plugins to disable themselves at startup.
By returning 'disable: <reason>' inside getmanifest or init result.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: plugins: plugins can now disable themselves by returning `disable`, even if marked important.
2021-01-13 14:45:36 +01:00
Rusty Russell 4bb05e46e9 offers: convert currency when they request an invoice.
Means a reshuffle of our logic: we want to multiply by quantity before
conversion for maximum accuracy.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-01-09 12:45:31 +01:00
Rusty Russell 030a19a8af sendinvoice: don't allow separate invoice and command timeouts.
It was too confusing, and can be added later if desired.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-01-09 14:34:35 +10:30
Rusty Russell fdc1f75745 doc: fix waitinvoice update.
Waitinvoice also returns once an invoice is expired.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-01-09 14:34:35 +10:30
Rusty Russell 8f37437a14 doc: update and fix listinvoices output in man page.
1. The field *expiry_time* is actually called *expires_at*.
2. The description field is missing.
3. The bolt11 field is missing.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-01-09 14:34:35 +10:30
Rusty Russell d867fab3a7 sendinvoice: call waitinvoice directly to on invoice payment.
Suggested-by: Christian Decker
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-01-09 14:34:35 +10:30
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
Christian Decker 91e406ed6f doc: Document existence of `erring_direction` in `sendpay` result
Fixes #3537
2021-01-08 19:28:30 +01:00
Rusty Russell 1a8978100e invoice: add ctlv option.
This is required if we want to create a "bouncer" plugin (in my copious free time!)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `invoice` now takes an optional `cltv` parameter.
2021-01-08 10:45:56 +01:00
Christian Decker 0d1b45dfcc json-rpc: Give `waitblockheight` an error code for timeouts
We need to differentiate timeouts from other results, so make it recognizable.
2021-01-08 09:19:24 +01:00
Christian Decker 2981184fac docs: Document `bolt11` and `payment_hash` arguments of listinvoices 2021-01-06 18:48:06 +01:00
Karol Hosiawa a2c208e121 Added spent option to listfunds
Changelog-Added: JSON-RPC: The `listfunds` method now includes spent outputs if the `spent` parameter is set to true.
2020-12-22 13:00:02 +01:00
ZmnSCPxj jxPCSnmZ 423f3944e3 doc/BACKUP.md: Minor typo due to rearranged text.
Changelog-None
2020-12-16 12:36:52 +01:00
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 723c16072a cleanups: feedback from Christian Decker review.
1. Hoist 7200 constant into the bolt12 heade2.
2. Make preimage the last createinvoice arg, so we could make it optional.
3. Check the validity of the preimage in createinvoice.
4. Always output used flag in listoffers.
5. Rename wallet offer iterators to offer_id iterators.
6. Fix paramter typos.
7. Rename `local_offer_id` parameter to `localofferid`.
8. Add reference constraints on local_offer_id db fields.
9. Remove cut/paste comment.
10. Clarify source of fatal() messages in wallet.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-12-15 12:05:02 +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 d971e3de98 Plugin: support extra args to "start".
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Plugins: `start` command can now take plugin-specific parameters.
2020-12-15 09:28:56 +10:30
Rusty Russell 8a9976c4c1 plugins: support concatenation of multiple args.
"multi" means that specifying a parameter twice will append, not override.
Multi args are always given as a JSON array, even if only one.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Plugins: new "multi" field allows an option to be specified multiple times.
2020-12-15 09:28:56 +10:30
niftynei 1ca2c66c54 make: have `git submodule update` be recursive
libwally added libsecp256k1 as a submodule, so we need to recursively
update the submodules now
2020-12-11 13:20:54 +01:00
Michael Schmoock 4507203a48 doc: fees on listpeers 2020-12-07 14:26:36 +01:00
niftynei e81d78ec4c fundpsbt/utxopsbt: new `min_witness_weight` param
Needed for v2 of channel opens, where the minimum weight is 110; a
'simple utxo' (sig + key) weighs in at 107, so we a need a way to
establish a floor for this case.

Changelog-Added: JSON-RPC: fundpsbt/utxopsbt have new param, `min_witness_utxo`, which sets a floor for the weight calculation of an added input
2020-12-02 14:19:08 +10:30
ZmnSCPxj jxPCSnmZ 32de621886 lightningd/plugin_hook.c: Make `db_write` a chained hook.
Fixes: #4219

Changelog-Changed: Plugins: Multiple plugins can now register `db_write` hooks.
2020-11-30 10:40:11 +10:30
niftynei 6077eca660 df: pass back 'close_to' for completed/commitment secured channels
When commitments are secured, also return the 'close_to' script if we've
got a local_upfront_shutdown_script set.
2020-11-23 12:41:05 -06:00
ZmnSCPxj jxPCSnmZ ff090ecfe6 doc/TOR.md: Add missing instructions to add user to Tor group.
Changelog-None

Fixes: #4208
2020-11-23 12:22:10 -06:00
ZmnSCPxj jxPCSnmZ dc83862fc2 doc/PLUGINS.md: Fix typo. 2020-11-23 12:13:09 -06:00
fiatjaf 9e4bed73d9 optional "failure_onion" in reply to htlc_accepted hook.
Changelog-Added: `htlc_accepted` hook can now return custom `failure_onion`.
2020-11-10 19:03:23 -06:00
Antoine Poinsot 6b347e1895 doc: document output descriptors in hsmtool
Touch a bit about it as a backup/recovery mechanism in the FAQ

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-11-10 10:34:13 -06:00
positiveblue fa1483a00d `hsm_secret` generation from a seed-phrase
tools: Add `generatehsm` method to hsmtool to derivate BIP32 seeds from a
mnemonic using the BIP39 standard.

The new method uses libwally for the BIP39 to BIP32 derivation. It also
fails if an hsm_secret file already exists, so we do not overwrite
someone else's wallet without noticing.

It allows the use of passphrases, the ECHO mode in the terminal is
disable for higher security.

It currently supports "en", "es", "fr", "it", "jp", "zhs", "zht".

Changelog-Added: hsmtool: `hsm_secret` generation from a seed-phrase following BIP39.
2020-11-09 17:49:24 -06:00
Rusty Russell fb295ffb51 plugin: sort topological candidates by specified order.
We previously registered hooks up in who-replies-to-getmanifest-first
order, but then if any had dependencies it would scatter that order.

This allows users to manually set dependencies developers have
forgotten by specifying the plugins manually in their configuration or
cmdline.  This was an excellent consideration by @mschmook.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-11-09 15:22:33 -06:00
Rusty Russell e2a31f42f2 plugins: allow 'before' and 'after' arrays for hooks.
The next patch will use these to order the hooks.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: plugins: hooks can now specify that they must be called 'before' or 'after' other plugins.
2020-11-09 15:22:33 -06:00
Michael Schmoock 86137852d2 doc: update channel_state_changed notification 2020-11-06 14:47:04 -06:00
fiatjaf 15b2546d45 doc: move "next_onion" and "shared_secret" to inside "onion". 2020-11-05 14:15:18 -06:00
Jan Sarenik 90ad541cd2 doc: STYLE.md fix "parameters get"
Changelog-None
2020-10-28 14:32:20 -05:00
Michael Schmoock 6697ebcebb doc: update HACKING.md 2020-10-23 12:47:47 -05:00
Michael Schmoock 5b542195d3 doc: typo in lightning-setchannelfee.7
Changelog-None
2020-10-23 12:47:47 -05:00
Rusty Russell 1e5789d421 close: add notification for slow closes.
For compatibility, we only do this if `allow-deprecated-apis` is false
for now.  Otherwise scripts parsing should use `grep -v '^# '` or
start using `-N none`.

Changelog-Added: JSON-RPC: `close` now sends notifications for slow closes (if `allow-deprecated-apis`=false)
Changelog-Deprecated: cli: scripts should filter out '^# ' or use `-N none`, as commands will start returning notifications soon
Fixes: #3925
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-10-23 13:53:16 +10:30
Rusty Russell 41290a436f lightning-cli: print notifications (with '# ' prefix) if received.
This can be suppressed with -N.

Note that we wull get an error with older lightningd, but we ignore it
anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: cli: print notifications and progress bars if commands provide them.
2020-10-23 13:53:16 +10:30
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
Antoine Poinsot 49dcb90b4e doc: add a document about our fuzz testing integration
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-21 19:34:39 +02:00
niftynei e66937e012 mfc: Add a `commitment_feerate` optional parameter to multifundchannel
Technically there *are* two feerates that we need to know:
  - the feerate to use for the funding transaction, and
  - the feerate to tell our peer to use for our commitment txs/htlc txs

As written, `multifundchannel` uses the same feerate for both. This
optional parameter will allow us to differentiate between the two, which
will be exceedingly handy for anchor output worlds. ;)

FIXME: test this

Changelog-Added: JSON API: `multifundchannel` has a new optional argument, 'commitment_feerate', which can be used to differentiate between the funding feerate and the channel's initial commitment feerate
2020-10-21 11:24:16 +10:30
niftynei daa55d1221 df: add notification for receiving peer's funding tx sigs
This will allow us to build complex, multi-peer transactions, with
easeTM!

Changelog-Added: EXPERIMENTAL, Plugins: `openchannel_peer_sigs` notification, which contains a peer's signatures for the funding transaction (`opt_dual_fund`)
2020-10-21 09:04:32 +10:30
niftynei 5c04ff1ad7 df: Pass the serial_id of the funding output to openchannel_init caller
This is handy/necessary for getting multifundchannel to work, as we need
to know what output to tell all the other peers about.

Changelog-Added: Experimental!! JSON-RPC: openchannel_init returns a field `funding_serial` that indicates the serial_id of the funding output in the provided PSBT
2020-10-21 06:22:18 +10:30
niftynei b696ec89a5 df-open: use channel_id for openchannel_update and openchannel_signed
Be as specific as possible is a good rule for things, I think
2020-10-20 12:50:31 +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
grubles f1eebb6c59
Add OpenBSD instructions to INSTALL.md (#4136)
Add OpenBSD instructions
2020-10-19 13:03:46 +02:00
niftynei 4926c25bb5 fundchannel: take a 'close_to' address
Finally, extends the 'close_to' functionality up to the flagship 'open a
channel' command.

Changelog-Added: JSON-API `fundchannel` now accepts an optional 'close_to' param, a bitcoin address that the channel funding should be sent to on close. Requires `opt_upfront_shutdownscript`
2020-10-16 13:51:57 +10:30
niftynei 628df74e26 mfc: allow a 'close_to' address to be passed in
This will allow us to let `fundchannel` handle a close to address, also
2020-10-16 13:51:57 +10:30
Jan Sarenik 2dd6b82dfb doc: reorder --mainnet before --testnet 2020-10-15 17:57:51 +02:00
Jan Sarenik b8c972a0e2 doc: Add missing signet to --help and man 2020-10-15 17:57:51 +02:00
Rusty Russell 4ba9ad66bc options: remove unused 'commit-fee-min/max' options.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-10-13 20:53:34 +02:00
Jan Sarenik 0b5e6c5be1 nit: doc/lightningd-config.5: Remove redundancy 2020-09-24 11:06:32 +09:30
niftynei 53ba34fe3a doc: correct weight numbers for fundpsbt 2020-09-17 10:14:22 +09:30
Rusty Russell 5bb6af6ba8 doc: note default proxy port.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-09-11 21:29:01 +09:30
Vincenzo Palazzo f62d7bbe45 Added additional fix to code formatting and English spelling.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2020-09-10 17:27:51 +09: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
Michael Schmoock 45a0e049e3 doc: plugin channel_state_changed 2020-09-10 10:24:06 +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
Christian Decker 210734f1b6 docs: Update the repro-build docs to the new docker-based system
Changelog-Added: New reproducible build system now uses docker: try it at home with `doc/REPRODUCIBLE.md`!
2020-09-09 20:22:42 +09:30
Vincenzo Palazzo 5679ea25f3 Fixed doc refused introduced inside the PR #4010
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2020-09-09 20:12:57 +09:30
ZmnSCPxj jxPCSnmZ e6a1819de8 doc/lightning-multifundchannel.7.md: Describe `minchannels` flag of `multifundchannel`. 2020-09-09 16:45:56 +09:30
ZmnSCPxj jxPCSnmZ 9460838650 doc/, contrib/: Additional support etc. for multifundchannel. 2020-09-09 16:45:56 +09:30
ZmnSCPxj jxPCSnmZ ee276bcb86 plugins/bcli.c: `sendrawtransaction` now has a required `allowhighfees` argument.
Changelog-Deprecated: plugin: `bcli` replacements should note that `sendrawtransaction` now has a second required Boolean argument, `allowhighfees`, which if `true`, means ignore any fee limits and just broadcast the transaction. Use `--deprecated-apis` to use older `bcli` replacement plugins that only support a single argument.
2020-09-09 12:38:19 +09:30
Rusty Russell 3a49320dd1 doc: language tidyups and a few minor refinements.
Some additional detail was warranted in several places, though the
listconfigs is better off simply referring to lightningd-config.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: doc: Many missing manual pages were completed
2020-09-08 14:55:29 +09:30
Vincenzo Palazzo d1c2c5c792 Fixed doc format and rebase
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2020-09-08 14:55:29 +09:30
Vincenzo Palazzo dde25b712c Fixed mistake inside the docs
Thanks @rustyrussell.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2020-09-08 14:55:29 +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 77b20754da Added getinfo documentation and add some minor fixing inside the my others changes.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2020-09-08 14:55:29 +09:30
Vincenzo Palazzo 19e4cf1126 Fixed grammar error to stop command documentation 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 348f5c50da Makefile: fix up sqlgen and docgen rules.
Omitted in commit d8e8426b52

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-09-08 12:49:02 +09:30
Vincenzo Palazzo c9687ab6ce Added proxy information to config information for plugins
Changelog-Added: Plugins: Proxy information now provided in init.configuration."

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2020-09-08 11:47:48 +09:30
Vincenzo Palazzo 6e16ee0eaa Alignment doc with the actual implementation
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2020-09-07 11:07:34 +09:30
Christian Decker 037f7201be make: Do not delete deployable-lightning.pdf on maintainer-clean
It is not part of the default documentation generation, thus will show up in
the git diff every time a maintainer-clean is done. We could also add it to
the default documentation generation, however it requires some rather
heavy-weight latex dependencies, and the file hasn't changed in several years.
2020-09-07 11:03:29 +09:30
Rusty Russell 5bedcbeed7 doc: regenerate lightningd-config man page.
Merged as SHA256STAMP was going in.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-09-02 09:30:25 +09:30
Rusty Russell 9b8f08a8a0 lightningd: return min-capacity-sat to its intended purpose.
And document exactly what it does: insist that an HTLC can pass of
this value (module assumptions of feerate).

Note that we remove the "is_opener" test from the capacity calculation
for anchor fees: it doesn't matter which side it is, someone has to pay
for anchor fees to it deducts from capacity.

This change breaks the test, which we rewrite.

Changelog-Changed: config: `min-capacity-sat` is now stricter about checking usable capacity of channels.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-09-01 12:27:39 -05:00
Rusty Russell bb250358ae Makefile: force regeneration of manpages, wire source.
Now that SHA256STAMP protects us, we can avoid timestamps altogether
so we don't get missing builds.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-08-31 21:33:26 -05:00
Rusty Russell a00179d557 doc, wiregen: use SHA256 stamps instead of git versions.
This should be more robust in future: we SHA256 all of the deps.
For wiregen we prefix with EXPERIMENTAL_FEATURES, since it can effect them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-08-31 21:33:26 -05:00
Rusty Russell dd8cd81e91 listpeers: add `features` array using BOLT9 names.
It's actually not possible to currently tell if you're using anchor_outputs
with a peer (since it depends on whether you both supported it at *channel open*).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-added: JSON-RPC: `listpeers` shows `features` list for each channel.
2020-08-28 14:46:09 -05:00
Rusty Russell b9ac032329 doc: force refresh of all manpages.
The idea is that you regenerate the man pages in the same commit you
alter them: that's how we know whether to try regenerating them or not
(git doesn't store timestamps, so it can't really tell).

Travis will now check this, so force them all to sync to this commit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-08-25 12:53:13 +09:30
Rusty Russell 67cde96397 Makefile: respect --quiet and V=1 in doc/Makefile.
And don't regen doc/index.rst unless there's good reason.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-08-25 12:53:13 +09:30
Rusty Russell ef3fbab551 invoice: don't allow zero-value invoices.
You can't pay them anyway, and at least one person used 0 instead of "any".

Closes: #3808
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: JSON-RPC: `invoice` no longer accepts zero amounts (did you mean "any"?)
2020-08-25 12:22:45 +09:30
Rusty Russell aab3808668 utxopsbt: let caller specify locktime, add tests and python binding.
Changelog-Added: JSON-RPC: `utxopsbt` takes a new `locktime` parameter
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-08-18 11:38:25 -05:00
Rusty Russell 14baaaa8ba fundpsbt: let caller specify locktime.
Required for dual funding where the opener sets it.

Changelog-Added: JSON-RPC: `fundpsbt` takes a new `locktime` parameter
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-08-18 11:38:25 -05:00
Rusty Russell bf5e99403e utxopsbt: make default to only allow unreserved utxos.
This more closely mirrors fundpsbt (which will only select unreserved ones)
but you can turn it off if you want to e.g. rbf in future.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: New low-level command `utxopsbt` to create PSBT from existing utxos.
2020-08-18 12:52:41 +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 bcd632f2ae listfunds: add "redeemscript" field.
You'd need this if you ever wanted to make your own PSBT.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: `listfunds` now has a `redeemscript` field for p2sh-wrapped outputs.
2020-08-13 12:37:02 -05:00
Rusty Russell 6b39731c6a fundchannel: provide outnum
It's currently always 0, but it won't be once we replace txprepare.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `fundchannel` has new `outnum` field indicating which output of the transaction funds the channel.
2020-08-13 12:37:02 -05:00
Dave Scotese d2bd1f0fa9 Update TOR.md
My testing shows that I received errors which turned out to be fatal ("/usr/libexec/c-lightning/lightning_connectd: libbacktrace: no debug info in ELF executable") when I had two `bind-addr=...` settings in my config file, which the instructions insinuated since c-lightning would already have been installed and runnable (therefore, already having a bind-addr).
2020-08-13 12:55:33 +02:00
Rusty Russell 7a7a849fc2 lightningd: allow plugin commands and options to mark themselves deprecated.
This lets us handle it the same way we handle builtin commands, and also
lets us warn if they use deprecated apis and allow-deprecated-apis=false.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Plugins: can now mark their options and commands deprecated.
2020-08-11 08:43:18 +09:30
Rusty Russell 151bc47583 JSON-RPC: getmanifest passes allow-deprecated-apis flag.
This allows plugins to choose how to present things in getmanifest.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: plugins: `getmanifest` may now include "allow-deprecated-apis" boolean flag.
Changelog-Deprecated: plugins: `getmanifest` without any parameters; plugins should accept any parameters for future use.
2020-08-11 08:43:18 +09:30
Rusty Russell 0cbc6447b7 doc: refer to correct option name in STYLE.md.
It's --allow-deprecated-apis=false.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-08-11 08:43:18 +09:30
Vincenzo Palazzo 1521c29fcf listpays mod 1: add destination inside the response when bolt11 is null
Changelog-Added: JSON-RPC: `listpays` now lists the `destination` if it was provided (e.g., via the `pay` plugin or `keysend` plugin)
2020-08-09 16:03:03 +02:00
Vincent 700897f06e listpays: fixed bolt11 null with keysend and update doc command
listpays: make doc-all missed
Changelog-Added: JSON-RPC: `listpays` can be used to query payments using the `payment_hash`
Changelog-Added: JSON-RPC: `listpays` now includes the `payment_hash`
2020-08-09 16:03:03 +02:00
ZmnSCPxj jxPCSnmZ 4ca2e49812 lightningd/plugin.c: Make builtin plugins important.
Changelog-Changed: plugin: Builtin plugins are now marked as important, and if they crash, will cause C-lightning to stop as well.
2020-08-04 13:27:51 -05:00
ZmnSCPxj jxPCSnmZ a847487bbe lightningd/plugin.c: Add important plugins, which if they terminate, lightningd also terminates.
Changelog-Added: New option `--important-plugin` loads a plugin is so important that if it dies, `lightningd` will exit rather than continue.  You can still `--disable-plugin` it, however, which trumps `--important-plugin` and it will not be started at all.
2020-08-04 13:27:51 -05:00
ZmnSCPxj jxPCSnmZ e7d89cd7de lightningd/invoice.c: Improve programmatic error reporting for `delinvoice`.
Changelog-Changed: JSON-RPC: `delinvoice` will now report specific error codes: 905 for failing to find the invoice, 906 for the invoice status not matching the parameter.
2020-07-31 23:57:32 +00:00
Christian Decker 14d08b75cd doc: Document the `msatoshi` parameter for `sendonion` 2020-07-28 16:17:39 +09:30
ZmnSCPxj jxPCSnmZ 8e02998161 doc/PLUGINS.md: Correct misspelling of `getchaininfo`.
Changelog-None
2020-07-27 22:35:30 +02:00
Rusty Russell 71a2aefafd sendonion: add bolt11 arg.
And document the partid arg.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `sendonion` has a new optional `bolt11` argument for when it's used to pay an invoice.
2020-07-27 13:11:14 +02:00
Rusty Russell 23af241c60 doc: document the payment_secret argument to sendpay.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-07-21 13:30:15 +02:00
Rusty Russell 73a5f5b313 fundpsbt: make parameters more usable.
fundpsbt forces the caller to manually add their weight * feerate
to the satoshis they ask for.  That means no named feerates.

Instead, create a startweight parameter and do the calc for them
internally, and return the feerate we used (and, while we're at it,
the estimated final weight).

This API change is best done now, as it would otherwise have to
be appended as a parameter.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-07-17 13:53:46 +02:00
Christian Decker de75d3ac0c mpp: Add CLI option to opt-out of multi-part payments
Several tests are not well-suited for mpp, so I added a CLI option to opt-out
of the MPP support at startup time.
2020-07-15 11:32:58 +02:00
Rusty Russell 406d0d09cf doc/STYLE.md: be clear we're talking about JSON output.
Suggested-by: @ZmnSCPxj
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-07-15 18:50:49 +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
Rusty Russell be17a9392f reserveinputs: add exclusive flag.
This is the normal case: you only want to reserve inputs which
are not already reserved.  This saves you iterating through the
results and unreserving some if you weren't exclusive.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-07-15 18:49:02 +09:30
Rusty Russell 56ea215ba0 wallet: new JSON commands reserveinputs and unreserveinputs.
reserveinputs marks UTXOs reserved for 12 hours, so we won't select them
for spending: unreserveinputs marks them available again.

Exposes param_psbt() for wider use.

Disabled the test_sign_and_send_psbt since we're altering the API;
the final patch restores it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-07-15 18:49:02 +09:30
Rusty Russell f53624517b doc: add JSON API advice.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-07-14 21:28:26 +02:00
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 b27f4e1f9a doc/lightning-feerates.7.md: Document `feerates` command.
Changelog-None
2020-07-13 08:45:30 +09:30
Rusty Russell 94de18ace7 listfunds: add scriptpubkey if it's known.
(Which it is, since 0.7.3).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON: `listfunds` now has a 'scriptpubkey' field.
2020-07-08 21:07:20 +02:00
ZmnSCPxj jxPCSnmZ deabab8934 lightningd/opening_control.c: `fundchannel_cancel` no longer requires a `channel_id` argument.
Fixes: #3785

Changelog-Changed: `fundchannel_cancel` no longer requires its undocumented `channel_id` argument after `fundchannel_complete`.
2020-07-02 01:10:59 +00:00
Christian Decker 9d36e49770 doc: Fix a documentation error in sendonion
Te `sendonion` docs where claiming that the `first_hop` needs to specify a
`channel_id` whereas it should really be the `node_id` of the peer we are
trying to contact.
2020-07-01 12:19:02 +02:00
Saibato e4cd2148ab Reflect in TOR.md that we need a Tor version >= 0.3.2.2-alpha to reach V3 onions
Changelog-None

Signed-off-by: Saibato <saibato.naga@pm.me>
2020-07-01 11:21:58 +02: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
Rusty Russell 42bf230bfc doc: regenerate and update.
My node tried to rebuild one of them because it was lagging (I noticed
because mrkd was not installed).

Turns out a few were lagging, and lightning-dev-sendcustommsg.7 was totally
empty!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-06-28 01:14:08 +00:00
niftynei 431463b57a listfunds: also list reserved outputs
Currently 'listfunds' lies, a teensy eeinsy bit, in that it doesn't list
all of the funds in a wallet (it omits reserved wallet UTXOs). This
change makes the reserved outputs visible by listing them in the
'outputs' section along with a new field, 'reserved', which denotes the
UTXO's state

Changelog-Changed: JSON-RPC: `listfunds` 'outputs' now includes reserved outputs, designated as 'reserved' = true
2020-06-16 15:58:58 +02:00
Christian Decker 1933cc2523 docs: Fix typo in the `pay` command docs 2020-06-15 16:14:53 +02:00
niftynei 27e83f075f doc: remove bitcoin PPA from install instructions, use snap
the PPA is no longer maintained, the new hotness is the snapd install.
except that snapd does some weirdness with the binary names, calling it
bitcoin-core.daemon and bitcoin-core.cli. To get around this, you can
create a symbolic link to the snap binaries, which is what we outline
here.
2020-06-01 23:18:15 +02:00
Glen Cooper 8d98b99bde Update TOR.md
typo: referes, changed to refer
2020-05-26 12:21:40 +09:30
Antoine Poinsot f598caa60d config: don't ignore the --commit-fee option.
We did not take the value of --commit-fee into account : this removes
the unused option from lightningd and instead registers it in bcli,
where we set the actual feerate of commitment transactions. This also
corrects the documentation.

Changelog-Fixed: config: we now take the --commit-fee parameter into account.
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-05-20 06:09:24 +09:30
Rusty Russell 3c625b367d doc: update cli documentation.
1. help now uses a boutique format, not -H.
2. document the -F option.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-05-15 15:25:44 +02:00
lisa neigut 8acbbca05d coins: use the chain's BIP173 name instead of a 'unit of account'
Updates the unit of account to be the chain_id, which is the BIP173 name
of the chain that the coins moved on.

Suggested-By: @rustyrussell
2020-05-12 15:46:58 +09:30
lisa neigut 44f747b29a coin moves: update PLUGINS.md with details about `coin_movement`s
Changelog-Added: Plugins: new notification type, `coin_movement`, which tracks all fund movements for a node
2020-05-12 15:46:58 +09:30
Christian Decker c7efe0bceb doc: Document the newly added commitment_revocation hook 2020-05-07 15:05:39 +09:30
Rusty Russell 24063ca972 lightningd: have plugin-disable be more persistent.
The previous implementation was a bit lazy: in particular, since we didn't
remember the disabled plugins, we would load them on rescan.

Changelog-Changed: config: the `plugin-disable` option works even if specified before the plugin is found.
2020-05-05 13:45:17 +09:30
rbndg e946b1889e Fixed PLUGIN.md comment for invoice creation 2020-05-04 19:18:05 +02:00
rbndg 241fa00e97 plugin:added invoice creation event
New invoice_creation event triggered when an new invoice is created

Changelog-Added: plugin: New invoice_creation plugin event
2020-05-04 19:18:05 +02:00
Sebastian Falbesoner 34ed2093ac doc: fix typo in STYLE.md (s/chanelog/changelog/)
Changelog-None
2020-05-04 10:47:56 +09:30
lisa neigut 0e20e3c5e7 df: rename 'funder' to 'opener'
Previously we've used the term 'funder' to refer to the peer
paying the fees for a transaction; v2 of openchannel will make
this no longer true. Instead we rename this to 'opener', or the
peer sending the 'open_channel' message, since this will be universally
true in a dual-funding world.
2020-05-04 10:22:26 +09:30
Aiden McClelland c485cf7dd1 docs: Add documentation for Alpine to INSTALL.md
Changelog-Added: docs: Install documentation now has information about building for Alpine linux
2020-04-30 19:27:39 -05:00
Christian Decker 9f298330b2 libplugin: It's featurebits, not features
The documentation was wrong, and I copied my mistake to `libplugin` where it
was then ignored instead of ORed into the node's featurebits. This fixes both.
2020-04-28 10:39:07 -05:00