Commit Graph

558 Commits

Author SHA1 Message Date
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
Antoine Poinsot 6e5aa1af14 doc: bitcoin backend must return sat/kVB not btc/kVB on `estimatefees`
Reported-by: SimonVrouwe <s_github@protonmail.com>
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-04-27 18:41:22 -05:00
Rusty Russell bf053dcf7c plugins: simplify htlc_accepted hook payload-setting API.
As discussed with Christian, prepending the length to the payload returned
is awkward, but it's the only way to set a legacy payload.  As this will
be soon deprecated, simplify the external API.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-04-16 18:03:35 +09:30
Rusty Russell 63441075b5 lightningd: allow htlc_accepted hook to replace onion payload.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-added: `htlc_accepted` hook can now offer a replacement onion `payload`.
2020-04-16 18:03:35 +09:30
Rusty Russell df31af5221 invoice: ignore dead-end heuristic on explicitly specified channels.
This makes testing easier, and makes sense: lightningd might not
*know* about other connected channels, depending on gossip, but if the
user specifies it we should obey it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: JSON: `invoice` `exposeprivatechannels` now includes explicitly named channels even if they seem like dead-ends.
2020-04-14 14:13:26 -05:00
Christian Decker 813356b88c docs: Correct the key names for estimatefees 2020-04-11 08:43:06 +09:30
Christian Decker f00e9d6ea8 doc: Give an example of the supported DSN formats
I was told that DSNs are not trivial to format, so this adds an example to
help setup the postgres wallet backend.
2020-04-11 08:43:06 +09:30
Christian Decker b68066e8e8 python: Consolidate requirements.txt files in a single place
We had them split according the separate use-cases:

 - testing
 - doc-gen
 - wire-gen

But that was causing new contributors to miss some dependencies when they
first got hacking. So this consolidates all of our own dependencies in a root
requirements.txt, with the notable exception of `pyln-client`, `pyln-testing`
and `pyln-proto` which are distributed as PyPI modules and therefore have
their own dependencies that need to be tracked in the module root.

Closes #3518
2020-04-09 15:14:06 +02:00
darosior 25405191fb doc: document the plugin interface to gather Bitcoin data
Changelog-Added: plugins: the interface to gather data from Bitcoin backend plugins is now final.
2020-04-09 14:21:15 +09:30
Vasil Dimov 662ac26d0c doc: fix typo: %s must be % (followup to 158d2212)
Changelog-None
2020-04-07 12:45:34 -05:00
Vasil Dimov 158d2212c2 closingd: configurable closing fee negotiation step
When negotiating the transaction fee for closing a channel [1], we used
to always pick the middle of the range between our proposal and the
peer's proposal.

Introduce a new option `fee_negotiation_step` to the close command, so
the peer who initiates the close can choose his back off step.

Partially resolves https://github.com/ElementsProject/lightning/issues/3270

[1] https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed

Changelog-Added: New optional parameter to the `close` command to control the closing transaction fee negotiation back off step
2020-04-07 13:52:48 +09:30
darosior ca36c21870 doc: fix FAQ formatting 2020-04-06 11:57:54 +02:00
darosior a5bd36c10a faq: add two new questions asked on IRC
Tim Ho asked about annouced IP addresses on IRC, and this was not
covered in the FAQ.
2020-04-03 20:04:54 -05:00
darosior b0c58f85ce doc: start an FAQ
This regroups questions (frequently) seen in Github issues, on IRC, and
also some I've been asked in face to face.

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

Christian wrote the block chain rescaning paragraph.
Lisa corrected my poor english grammar.
Co-Authored-by: Christian Decker <decker.christian@gmail.com>
Co-Authored-by: Lisa Neigut <niftynei@gmail.com>
2020-04-03 20:04:54 -05:00
Rusty Russell 28e3ffc66b plugins/fundchannel: make 'all' do the right thing for wumbo.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-04-03 13:13:21 +10:30
Rusty Russell 07a281faf8 lightningd: add large-channels / wumbo option.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-added: `large-channels` option to negotiate opening larger channels.
2020-04-03 13:13:21 +10:30
Rusty Russell 41ebaffba3 lightningd: return `features` in connect response.
This is useful in general, but in particular it allows fundchannel to avoid YA
query to figure out if it can wumbo.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON: `connect` returns `features` of the connected peer on success.
2020-04-03 13:13:21 +10:30
Rusty Russell a7cc6d33c3 plugins: actually change global features when plugins tell us to.
This cleans up the boutique handling of features, and importantly, it
means that if a plugin says to offer a feature in init, we will now
*accept* that feature.

Changelog-Fixed: Plugins: setting an 'init' feature bit allows us to accept it from peers.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-03-31 13:36:02 +02:00
Rusty Russell a430abf899 connectd: permit multiple descriptors of the same type.
This restriction was removed from the spec as of
86c2ebcc5973a4133d3ce4d80ae1c203061a1646.

We also fix up some strange formatting in that part of the documentation.

Changelog-changed: We now announce multiple addresses of the same type, if given.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-03-31 13:36:02 +02:00
Michael Schmoock c6495c185c doc: adds receivable_msat to manpage 2020-03-27 12:33:23 +01:00
lisa neigut 42cce55b45 plugins: add 'flag' type for plugin options
Updates the plugin docs to include more detailed info about how options
work.

Changelog-Added: Plugins: 'flag'-type option now available.
2020-03-21 16:29:52 +10:30
Michael Schmoock f2478e9160 doc: point out 8char visual tabs in STYLE.md
Changelog-None
2020-03-19 10:45:35 +01:00
darosior 524d22e4cc doc: update listchannels manpage
After #3576 ..
2020-03-09 16:03:39 +01:00
Dave Scotese 53913c5119 Use of null
I added a hint how to specify source but not short channel id.
2020-03-07 15:48:22 +01:00
darosior 6f41d18a92 doc: add pyln-proto to PYTHONPATH for pytest in HACKING 2020-03-04 16:41:43 +01:00
ZmnSCPxj jxPCSnmZ d9b2482415 lightningd/hsm_control.c: Implement `getsharedsecret`.
ChangeLog-Added: New `getsharedsecret` command, which lets you compute a shared secret with this node knowing only a public point. This implements the BOLT standard of hashing the ECDH point, and is incompatible with ECIES.
2020-02-28 14:45:50 +10:30
Christian Decker 7f6f324590 python2: Remove python2 dependency from docs and dockerfiles 2020-02-27 09:18:24 +10:30
Vasil Dimov 89ceb273f5 wire: remove towire_double()
Before this patch we used to send `double`s over the wire by just
copying them. This is not portable because the internal represenation
of a `double` is implementation specific.

Instead of this, multiply any floating-point numbers that come from
the outside (e.g. JSONs) by 1 million and round them to integers when
handling them.

* Introduce a new param_millionths() that expects a floating-point
  number and returns it multipled by 1000000 as an integer.

* Replace param_double() and param_percent() with param_millionths()

* Previously the riskfactor would be allowed to be negative, which must
  have been unintentional. This patch changes that to require a
  non-negative number.

Changelog-None
2020-02-27 09:07:04 +10:30
Rusty Russell faac4b28ad plugins: support failure_message in invoice and htlc_accepted hooks.
As promised in the Changelog when we converted from failcodes to messages
internally.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-02-25 11:12:12 +10:30
darosior 230cebfb35 doc: clarify txprepare usage 2020-02-21 17:52:02 +01:00
ZmnSCPxj jxPCSnmZ 541472b77c doc/lightning-listpeers.7.md: Clarify `spendable_msat`.
Fixes: #3524

ChangeLog-none
2020-02-18 10:22:26 +10:30
Michael Schmoock ba36dfeba3 doc: all requirements.txt are needed for testing
the tests are not possible only by having tests/requirements.txt .
Running the whole testsuite also runs contrib/pyln-proto/tests/test_invoice.py
which needs requiremnets of pyln-proto and so on.

Also requirement coincurve requires libsecp256k1-dev headers.
As most developers need all requiremtents and we should tell them.
2020-02-18 10:10:17 +10:30
Rusty Russell 73f760342b doc: remove two more references to the '[Unreleased]' in CHANGELOG.md
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-02-17 19:07:09 +10:30
Rusty Russell 2c88ab53d4 doc: update MAKING-RELEASES.
1. GH_TOKEN is probably required to run the changelog script.
2. Note the footnotes need updating; we no longer have [Unreleased].

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-02-12 16:23:28 +10:30
ZmnSCPxj jxPCSnmZ 5c7f9b542a doc/lightning-listpeers.7.md: Expand and correct.
ChangeLog-Fixed: Corrected and expanded `lightning-listpeers.7` documentation.
2020-02-12 11:06:17 +10:30
Christian Decker c223932e40 doc: Update plugins.md to describe the chain-mode for hooks 2020-02-11 15:57:22 +10:30
Christian Decker bdbbfaeb40 doc: Reduce useless nesting in plugins.md
Triple nesting seems a bit excessive, I can't even read the titles in the
sidebar of http://lightning.readthedocs.org anymore :-)
2020-02-11 15:57:22 +10:30
Rusty Russell 30580731a6 Minor fixups on PR #3477
Feedback from @niftynei and me; nothing major, but avoids
another round-trip.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-02-11 13:53:31 +10:30
Christian Decker 5bd419d9fd doc: Document the featurebits functionality for plugins 2020-02-11 13:53:31 +10:30
ZmnSCPxj jxPCSnmZ e6c486f87c doc/lightning-listchannels.7.md: Fix factual errors.
Changelog-Fixed: Fixed factual errors in `lightning-listchannels.7` documentation.

`delay` is ***not*** the unilateral close delay for that channel-direction!
2020-02-10 15:57:55 +10:30
ZmnSCPxj jxPCSnmZ 6e34aa233a lightningd/: Hooks now support a consistent interface for 'no operation'.
Changelog-Changed: The hooks `db_write`, `invoice_payment`, and `rpc_command` now accept `{ "result": "continue" }` to mean "do default action", in addition to `true` (`db_write`), `{}` (`invoice_payment`), and `{"continue": true}` (`rpc_command`). The older "default" indicators are now deprecated and are now recognized only if `--deprecated-apis` is set.
2020-02-04 01:07:59 +00:00
Ken Sedgwick 5fd0ed79f4
lightningd: Added --subdaemon command to allow alternate subdaemons.
Changelog-Added: lightningd: Added --subdaemon command to allow alternate subdaemons.

[ Wow, that was mammoth; 44 comments over 12 commits. Feels almost unfair to squash it into one commit, so I wanted to note @ksedgwic's perseverence here! --RR ]
2020-02-04 10:44:13 +10:30
Vasil Dimov 149620ee0f build: fix and simplify doc/index.rst generation
* Fix usage of `echo "...\n..."` (without `-e`), generating a
broken output:
```
   lightningd-config <lightningd-config.5.md>
   lightningd\nlightning-autocleaninvoice.7.md <lightningd.8.md\nlightning-autocleaninvoice.7.md>
```

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

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

* Sort all man pages as one block.

Changelog-None
2020-02-03 15:38:11 +00:00
ZmnSCPxj jxPCSnmZ 9346043f94 doc/PLUGINS.md: Mention `data_version` field of `db_write`, sketch how the backup plugin should work.
ChangeLog-Added: Fully documented `db_write` hooks in `doc/PLUGINS.md`.
2020-02-03 13:32:35 +01:00
ZmnSCPxj jxPCSnmZ fd76b8bfba doc/: Doc clarifications regarding connecting and funding.
ChangeLog-Fixed: Clarified about connection in documentation.  Also, `fundchannel`  already `connect`s if your node knows how to contact the desired peer for a few versions now, so clarify documentation about this as well.
2020-02-01 16:53:01 +01:00
Rusty Russell f3600d22a0 lightningd: disallow `msatoshi` arg to sendpay unless exact when non-MPP.
Using it with a different value to the amount sent causes a crash in 0.8.0,
which is effectively deprecating it, so let's disallow it now.

Changelog-Changed: If the optional `msatoshi` param to sendpay for non-MPP is set, it must be the exact amount sent to the final recipient.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-01-31 14:23:18 +01:00
Vasil Dimov 55173a56b7 Use dedicated type for error codes
Before this patch we used `int` for error codes. The problem with
`int` is that we try to pass it to/from wire and the size of `int` is
not defined by the standard. So a sender with 4-byte `int` would write
4 bytes to the wire and a receiver with 2-byte `int` (for example) would
read just 2 bytes from the wire.

To resolve this:

* Introduce an error code type with a known size:
  `typedef s32 errcode_t`.

* Change all error code macros to constants of type `errcode_t`.
  Constants also play better with gdb - it would visualize the name of
  the constant instead of the numeric value.

* Change all functions that take error codes to take the new type
  `errcode_t` instead of `int`.

* Introduce towire / fromwire functions to send / receive the newly added
  type `errcode_t` and use it instead of `towire_int()`.

In addition:

* Remove the now unneeded `towire_int()`.

* Replace a hardcoded error code `-2` with a new constant
  `INVOICE_EXPIRED_DURING_WAIT` (903).

Changelog-Changed: The waitinvoice command would now return error code 903 to designate that the invoice expired during wait, instead of the previous -2
2020-01-31 06:02:47 +00:00
Christian Decker 602b81fef2 doc: Add a section about the `custommsg` hook in the plugin doc 2020-01-28 23:50:52 +01:00
Christian Decker a3ddf9be9b docs: Add manpage for dev-sendcustommsg
It's a dev-* command for now, but better document it so people can use it
rather than having them guess how it's supposed to work.
2020-01-28 23:50:52 +01:00
ZmnSCPxj jxPCSnmZ 67590fc6be lightningd/invoice.c: Add `timeout` parameter to `waitanyinvoice`.
Fixes: #3192

Changelog-Added: `waitanyinvoice` now supports a `timeout` parameter, which when set will cause the command to fail when the timeout is reached; can set this to 0 to fail immediately if no new invoice has been paid yet.
2020-01-28 14:07:52 +01:00
ZmnSCPxj jxPCSnmZ 1e3fb8e750 doc/TOR.md: Mention about `statictor`.
Changelog-None
2020-01-28 13:46:33 +10:30
ZmnSCPxj jxPCSnmZ 7f4ed54b46 lightningd/jsonrpc.c: Set JSON-RPC socket permissions by command line.
Changelog-Added: Can now set the permissions on the JSON-RPC socket by `--rpc-file-mode`.
2020-01-27 21:11:57 +01:00
darosior f619124cb9 doc: update readthedocs index 2020-01-27 16:24:12 +00:00
darosior 6489e63991 doc/INSTALL: correct some typos
A double `git` and a `mode`.
2020-01-24 18:25:59 +01:00
ZmnSCPxj 54cc735201 lightningd/peer_control.c: Implement waitblockheight.
This is needed to fully implement handling of blockheight disagreements
between us and payee.
If payee believes the blockheight is higher than ours, then `pay`
should wait for our node to achieve that blockheight.

Changelog-Add: Implement `waitblockheight` to wait for a specific blockheight.
2020-01-21 22:23:21 +01:00
Vasil Dimov fc75d8a9e6 connectd: add own err codes instead of generic -1
Make it possible for connectd to send an error code to lightningd in
addition to the error message. Introduce two new error codes, replacing
the catch-all -1.

This change, together with
https://github.com/ElementsProject/lightning/pull/3395
will implement https://github.com/ElementsProject/lightning/issues/3366

Changelog-Changed: The `connect` command now returns its own error codes instead of a generic -1.
2020-01-21 16:59:18 +01:00
Vasil Dimov 3cf91b23b9 doc: unify man pages error sections
Change all man pages to follow the style of doc/lightning-pay.7.md for
the section on returning errors.

Changelog-None
2020-01-21 12:49:33 +08:00
Vasil Dimov 89466f0e55 doc: list the error codes of funding_* commands
Changelog-None
2020-01-21 12:49:33 +08:00
Vasil Dimov 3186215058 doc: update FreeBSD installation instructions
Now that c-lightning is in the FreeBSD ports system (\o/)
update the installation instructions, which basically boil down
to just `pkg install c-lightning`.

Changelog-None
2020-01-17 21:56:34 +01:00
fanquake 46f879d73f doc: openSSL is no longer required to build bitcoind
OpenSSL is no longer required after
https://github.com/bitcoin/bitcoin/pull/17265.

libsodium has never been required to build bitcoind on macOS.
2020-01-12 14:31:11 +01:00
Vasil Dimov 0ac91b4f99 doc: fix typo: s/these test/these tests/
Changelog-None
2020-01-06 12:57:59 +01:00
Vasil Dimov 50e7ecbe87 doc: add missing ":" in lightning-listpeers.7
Changelog-None
2020-01-06 12:57:59 +01:00
ZmnSCPxj ccece764f2 doc/lightningd.8.md: Fix formatting, remove old version.
Changelog-none
2020-01-05 03:00:47 +08:00
Rusty Russell c74fceb4c9 JSON RPC: invoice exposeprivatechannels can specify exact channels.
Changelog-Changed: JSON API: `invoice` `exposeprivatechannels` can specify exact channel candidates.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-01-04 08:07:22 +08:00
minidisk1147 f22595596a removed duplicate log-level subsystem 2020-01-02 16:40:24 +01:00
minidisk1147 1715b3d004 updated FreeBSD install instructions 2020-01-02 16:40:24 +01:00
Christian Decker b1e18e16a5 docs: Fix the `htlc_accepted` JSON payload in the docs
Had a spurious `}` in the example.
2020-01-02 16:05:52 +01:00
lisa neigut 689dd28ddd funding: enable push_msat
it's that time of year (merry xmas!)

enables the ability to push_msat on fundchannel

Changelog-Added: RPC: `fundchannel` and `fundchannel_start` can now accept an optional parameter, `push_msat`, which will gift that amount of satoshis to the peer at channel open.
2019-12-24 12:04:01 -06:00
Vasil Dimov b14b2b0490 doc: fix typos and minor rewording in doc/PLUGINS.md
Changelog-None
2019-12-17 23:21:51 +08:00
Vasil Dimov bf1f768a82 doc: fix the path to the sqlite database file
The sqlite database location has been changed in aab83e72.

Changelog-None
2019-12-16 15:31:42 +01:00
Vasil Dimov 1fe8cd8149 doc: fix typos in doc/TOR.md 2019-12-16 13:02:27 +01:00
Vasil Dimov 250fc79e93 doc: remove trailing whitespace from doc/TOR.md 2019-12-16 13:02:27 +01:00
Rusty Russell 839909d2cf Protocol: make var_onion, payment_secret and basic_mpp non-EXPERIMENTAL.
Thanks to @t-bast, who made this possible by interop testing with Eclair!

Changelog-Added: Protocol: can now send and receive TLV-style onion messages.
Changelog-Added: Protocol: can now send and receive BOLT11 payment_secrets.
Changelog-Added: Protocol: can now receive basic multi-part payments.
Changelog-Added: RPC: low-level commands sendpay and waitsendpay can now be used to manually send multi-part payments.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-12-12 22:16:03 +01:00
Vasil Dimov 38d88f1aff doc: fix commit-time formatting 2019-12-11 16:19:43 +01:00
darosior b4c18a10cf doc/lightningd-config: precise alias are 32 __bytes__ long.
And not 32 characters long, as a character (for example 🐨) can be 4
bytes long.

Reported-By: Vasil Dimov <@vasild>
2019-12-11 16:19:43 +01:00
darosior 2986854c88 doc/lightningd-config: correct misaligned RGB option paragraph 2019-12-11 16:19:43 +01:00
Rusty Russell f7ebbb2ec5 common: make sphinx code ignorant of payload format.
Now "raw_payload" is always the complete string (including realm or length
bytes at the front).

This has several effects:
1. We can receive an decrypt an onion which is grossly malformed.
2. We can still hand this to the htlc_accepted hook.
3. We then fail it unless the htlc_accepted accepts it manually.
4. The createonion API now takes the raw payload, and does not know
   anything about "style".

The only caveat is that the sphinx code needs to know the payload
length: we have a call for that, which simply tells it to copy the
entire onion (and treat us as the final node) if it's invalid.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-12-09 14:33:31 +01:00
Rusty Russell f8d8348c9f doc: add 'id' to rpc_command
It's required, so at least hint about its presence!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-12-08 15:26:28 +01:00
Rusty Russell 4683d096dd doc: feerate is not obvious, refer to fundchannel documentation:
It has a whole *two paragraphs* on it:

*feerate* is an optional feerate used for the opening transaction and as
initial feerate for commitment and HTLC transactions. It can be one of
the strings *urgent* (aim for next block), *normal* (next 4 blocks or
so) or *slow* (next 100 blocks or so) to use lightningd’s internal
estimates: *normal* is the default.

Otherwise, *feerate* is a number, with an optional suffix: *perkw* means
the number is interpreted as satoshi-per-kilosipa (weight), and *perkb*
means it is interpreted bitcoind-style as satoshi-per-kilobyte. Omitting
the suffix is equivalent to *perkb*.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-12-04 08:35:50 -06:00
Saibato b18510a7e3 Reflect the changes in documentation
Signed-off-by: Saibato <saibato.naga@pm.me>
2019-12-03 23:35:18 +01:00
fiatjaf 99ff86f6fe update docs with `payment_preimage`.
Changelog-Added: JSON-RPC: `listinvoices` now displays the payment preimage if the invoice was paid.
2019-12-03 01:16:07 +00:00
Christian Decker 21b5b59c8c json-rpc: Rename onion payload type to style
Suggested-by: Rusty Russell <@rustyrussell>
2019-12-01 15:40:47 +01:00
Christian Decker 2080416a89 doc: Add manpages for `createonion` and `sendonion`
Changelog-Added: Added `createonion` and `sendonion` JSON-RPC methods allowing the implementation of custom protocol extensions that are not directly implemented in c-lightning itself.
2019-12-01 15:40:47 +01:00
Michael Schmoock 895e06122c doc: adds pyln deps to command for running blackbox tests
This one got missing when introducting `pyln` packages as test dependencies.
2019-11-29 21:23:23 +01:00
Rusty Russell ebac3d2a85 spec: update to experimental BOLTs with secret/total_amount.
Also pulls in a new onion error (mpp_timeout).  We change our
route_step_decode_end() to always return the total_msat and optional
secret.

We check total_amount (to prohibit mpp), but we do nothing with
secret for now other than hand it to the htlc_accepted hook.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-11-24 23:33:17 +00:00
Rusty Russell a56f2b25b0 common: parse --allow-deprecated-apis extremely early.
We're going to want this for changing the default network.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-11-23 22:42:34 +00:00
Rusty Russell aab83e729b lightningd: change config-dir from plugin / wallet / hsm POV into <network> subdir
Changelog-changed: .lightningd plugins and files moved into <network>/ subdir
Changelog-changed: WARNING: If you don't have a config file, you now may need to specify the network to lightning-cli
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-11-23 22:42:34 +00:00
Rusty Russell dc23c308e4 config: Read both top-level and network-subdir config files.
This lets you have a default, but also a network-specific config.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-changed: Options: `config` and <network>/`config` read by default.
2019-11-23 22:42:34 +00:00
Rusty Russell 8b1aa3ef8b lightningd: move basic parameter parsing into common/configdir
lightning-cli is going to need to know what network we're on, so
it will need to parse the config files.  Move the code which does
the initial bootstrap parsing into common, as well as the config
file parsing core.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-11-23 22:42:34 +00:00
Rusty Russell 34c89cb226 config: Add include directive support.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Config: configuration files now support `include`.
2019-11-23 22:42:34 +00:00
lisa neigut de16d0f0b4 openchannel hook: add new `close_to` field
Rounds out the application of `upfront_shutdown_script`, allowing
an accepting node to specify a close_to address.

Prior to this, only the opening node could specify one.

Changelog-Added: Plugins: Allow the 'accepter' to specify an upfront_shutdown_script for a channel via a `close_to` field in the openchannel hook result
2019-11-22 00:41:15 +00:00
Rusty Russell 709c98f539 logging: remove spaces from subsystem names.
Spaces just make life a little harder for everyone.

(Plus, fix documentation: it's 'jsonrpc' not 'json' subsystem).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-11-18 04:50:22 +00:00
Rusty Russell 0aad532db1 logging: add examples for logging.
As suggested by @cdecker, but also did a bit of minor reformatting.

I don't like the excessive indenting in our man pages though,
but that's a separate problem.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-11-18 04:50:22 +00:00
Rusty Russell 0607f998d1 options: allow --log-level <level>:<prefix> for finegrained log control.
This allows finegrained logging control of particular subdaemons or
subsystems.

To do this, we defer setting the logging levels for each log object
until after early argument parsing (since e.g. "bitcoind" log object
is created early).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-changed: Options: log-level can now specify different levels for different subsystems.
2019-11-18 04:50:22 +00:00
Rusty Russell b0a72a67e8 doc/lightningd-config.5.txt: remove
Replaced by doc/lightningd-config.5.md.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-11-18 04:50:22 +00:00
Rusty Russell c83834ca82 lightningd: expose/accept "style" parameter in routes.
Default is legacy.  If we have future styles, new strings can be defined,
but for now it's "tlv" or "legacy".

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-11-14 10:15:33 +01:00
Rusty Russell 2a2259083a lightningd: handle tlv-style payloads.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-changed: JSON API: `htlc_accepted` hook has `type` (currently `legacy` or `tlv`) and other fields directly inside `onion`.
Changelog-deprecated: JSON API: `htlc_accepted` hook `per_hop_v0` object deprecated, as is `short_channel_id` for the final hop.
2019-11-14 10:15:33 +01:00
darosior 6427ccba50 Document the 'rpc_command' hook 2019-11-11 22:30:01 +01:00
darosior 5766231d98 pay: restore payment value randomization through shadow routing
When doing the random walk through the channel, we now add the fees
(both the base and the proportional one) for that channel in addition to
the cltv delta.

Changelog-Added: Payment amount fuzzing is restored, but through shadow routing.
2019-11-08 03:27:58 +00:00
Christian Decker 290b4d68b3 changelog: Add a tool to extract changelog entries from the commits
Since the `CHANGELOG.md` file is a major source for merge conflicts I decided
to build a tiny tool that generates the entries for the changelog
automatically from the commit messages.
2019-11-08 00:23:09 +00:00
lisa neigut 7374134dab doc: add reminder to close out Milestone to Making-Releases 2019-11-01 18:55:54 +01:00
lisa neigut 16fde5c79d releases: break up first git tag for verification purposes
I'm not sure what went wrong, but the first RC I cut had some trouble
with the tag being picked up with `git describe`, I think it was missing
a 'tag message'. I'm not sure what caused this.

This commit breaks up the first git tag procedure to have the releaser
verify that the tag command works as intended (and sensitizes them to
checking this for subsequent release cuts, if necessary)
2019-11-01 18:55:54 +01:00
lisa neigut c581fd9956 releases: update with niftynei's notes from release 0.7.3 2019-11-01 18:55:54 +01:00
arowser 67ce27aac7 remove repeat line in doc/requirements.txt 2019-10-29 12:18:45 -05:00
arowser cd894468e7 remove repeat install dependencies 2019-10-29 12:18:45 -05:00
Kristaps Kaupe e16ac08f6f Change order of paragraphs in manpage of fundchannel 2019-10-21 14:01:49 +02:00
lisa neigut 422b4502d3 funding: add RPC arg to specify a 'close_to' address
Takes advantage of upfront-shutdown-script to permit users to
specify the close-to address for a channel at open, by adding
a `close_to` field to `fundchannel_start`.

Note that this only is in effect if `fundchannel_start` returns
with `close_to` set -- otherwise, peer doesn't
support `option_upfront_shutdown_script`.
2019-10-15 19:10:05 +02:00
Rusty Russell ad48814746 doc: man pages for checkmessage and signmessage.
They're a little subtle, so let's spell out exactly what checkmessage
means.  In particular, we avoid discussing key derivation from a
signature, as it tends to get people (like me!) into trouble: we
describe it instead as iterating through every known node.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-10-14 18:58:44 -05:00
Rusty Russell bd55f6d940
common/features: only support a single feature bitset.
This is mainly an internal-only change, especially since we don't
offer any globalfeatures.

However, LND (as of next release) will offer global features, and also
expect option_static_remotekey to be a *global* feature.  So we send
our (merged) feature bitset as both global and local in init, and fold
those bitsets together when we get an init msg.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-10-11 02:52:04 +00:00
darosior a698395bf0 lightningd: '--encrypted-hsm', a new startup option
Add a new startup option which will, if set, prompt the user for a
password to derive a key from. This key will later be used to encrypt
and/or decrypt `hsm_secret`.

This was made a noarg option even if it would have been preferable to
let the user the choice of how to specify the password. Since we have
to chose, better to not let the password in the commands history.
2019-10-09 22:00:38 -05:00
trueptolemy e53d065230 doc: Update the doc about `destination` of `close` 2019-10-09 21:04:16 -05:00
trueptolemy e4cd5df06c doc: Use `amount` as the parameter name for `fundchannel` 2019-10-09 16:51:42 -05:00
trueptolemy 25583ffe37 doc: Use `amount` as the parameter name for `fundchannel` 2019-10-09 16:51:42 -05:00
trueptolemy c6a4bac8b6 Fix: Fix the doc of `txprepare`. Add the description of some parameters. 2019-10-09 16:51:42 -05:00
darosior 0d73777695 doc: update mrkd requirement 2019-10-05 03:25:12 +00:00
darosior 61c07bca45 doc: Document the changes to the 'plugin' command 2019-09-30 00:20:16 +00:00
darosior 2c43606895 doc: update mrkd version
The new tag includes @cdecker's modifications for better list handling
2019-09-29 14:06:40 +02:00
Saibato 32a1b782f3 Add lines in regard to enable-autotor-v2-mode flag to doc files
Signed-off-by: Saibato <saibato.naga@pm.me>
2019-09-28 00:31:02 +02:00
lambrosini 6999a4ce2d Remove the python-dev dependency which is useless in python3 2019-09-25 20:37:50 +02:00
lambrosini eb28268bd7 Install in the OS dependencies required to successfully install the python requirements 2019-09-25 20:37:50 +02:00
lambrosini 08573fbc4b Clone the repository before than installing requirements, which are specified in the repository 2019-09-25 20:37:50 +02:00
Christian Decker 5953a5051c cli: Add command line option to specify the wallet location
Will be demuxed into starting the selected DB backend in one of the next
commits. Defaults to the old database location.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2019-09-22 02:03:43 +00:00
fiatjaf 1d5bbc874a format JSON snippets with jq. 2019-09-21 19:41:43 +02:00
Rusty Russell fe66b53fb9 jsonrpc: add more fields to listfunds.
This avoids having to correlate with listpeers for the most pertinent
information.

This API predates plugins, otherwise we'd have listutxos and listpeers
and this would simply combine them appropriately.  Still, it exists so
there's little reason not to make it more friendly.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-09-19 01:03:09 +00:00
darosior 697b501132 doc: place lightningd manpages first in index.rst 2019-09-16 13:16:08 +02:00
Jacob Rapoport 6360ffb2ac fix macOS build & update docs 2019-09-16 05:08:42 +00:00
trueptolemy a795f5e600 doc: Update the document of `getroute`about excluding nodes 2019-09-16 12:22:06 +08:00
lisa neigut 5c70890efa rpc: add 'utxos' parameter to txprepare + withdraw
Allow a user to select the utxo set that will be added to a
transaction, via the `utxos` parameter. Optional.

Format for utxos should be of the form ["txid:vout","..."]
2019-09-11 23:56:27 +00:00