Commit Graph

229 Commits

Author SHA1 Message Date
darosior 8f8e955421 Update installation instructions and Dockerfile
Get rid of the 'asciidoc' dependency, make developers also install 'doc/requirements.txt'
2019-08-30 00:34:11 +00:00
Rusty Russell c2f58aec9d contrib/plugins: cowsay
___________________________________________________________________________
/ The most important plugin. Ever. Much thanks to @practicalswift and @jb55 \
\ for their improvements!                                                   /
 ---------------------------------------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-08-26 23:10:36 +00:00
Simon Vrouwe 2f5f364e17 pylightning/plugin: add `lightning_version` member to plugin 2019-08-26 15:39:03 -07:00
Rusty Russell 997af6f3f4 contrib: make stricter shellcheck from Ubuntu 18.04 happy
In contrib/bootstrap-node.sh line 7:
if type lightning-cli >/dev/null 2>&1; then
   ^-- SC2039: In POSIX sh, 'type' is undefined.

In contrib/startup_regtest.sh line 41:
	type lightning-cli || return
        ^-- SC2039: In POSIX sh, 'type' is undefined.

In contrib/startup_regtest.sh line 42:
	type lightningd || return
        ^-- SC2039: In POSIX sh, 'type' is undefined.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-08-23 08:22:28 -07:00
Sjors Provoost 55776c1605 systemd: After=network-online.target 2019-08-20 20:14:36 +02:00
Nicolas Dorier a358b9ab57 [Docker] Fixing the environment variable for arm32 2019-08-19 07:09:47 +00:00
Rusty Russell 403c054c4e contrib: add mako requirement to docker files.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-08-16 00:26:09 +00:00
nicolas.dorier 6cf42fe6c1 Add python-mako to the arm32 build 2019-08-12 05:44:11 +00:00
nicolas.dorier 19cf199f0e Add docker ARM64 support 2019-08-11 18:19:22 +02:00
Rusty Russell 7a592a2b5c contrib/startup_regtest.sh: avoid getting stuck in initialblockdownload.
And give a hint as to what cmds are available, since I forget!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-08-10 19:07:13 +02:00
Rusty Russell 2a09124574 contrib/startup_regtest.sh: set sane defaults for lightning & bitcoin dirs.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-08-10 19:07:13 +02:00
Rusty Russell 83e654a106 close: change to a unilateraltimeout argument.
`close` takes two optional arguments: `force` and `timeout`.
`timeout` doesn't timeout the close (there's no way to do that), just
the JSON call.  `force` (default `false`) if set, means we unilaterally
close at the timeout, instead of just failing.

Timing out JSON calls is generally deprecated: that's the job of the
client.  And the semantics of this are confusing, even to me!  A
better API is a timeout which, if non-zero, is the time at which we
give up and unilaterally close.

The transition code is awkward, but we'll manage for the three
releases until we can remove it.

The new defaults are to unilaterally close after 48 hours.

Fixes: #2791
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-08-09 05:47:16 +00:00
lisa neigut 0bd95fc068 contrib: add txindex to bitcoind for regtest 2019-08-09 05:07:18 +00:00
Rusty Russell 2f30cdc731 contrib: simple script to bootstrap node.
The helpme plugin is more comprensive, but this at least connects to a
few random nodes, and doesn't require python libraries in path or anything.

I selected the nodes from helpme.py, eliminating ones I couldn't reach.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-08-07 21:13:17 +08:00
darosior ed63496152 Pylightning: update to use the 'dev' multiplex command
Update 'dev_crash()' and 'dev_rhash()' methods which used outdated RPC commands, add the missing 'dev_slowcmd()' method.
2019-08-07 01:50:42 +00:00
Christian Decker 9d4148ce68 pylightning: Warn users of plugins that may break due to extra args
We recently noticed that the way we unpack the call arguments for hooks and
notifications in pylightning breaks pretty quickly once you start changing the
hook and notification params. If you add params they will not get mapped
correctly causing the plugin to error out.

This can be fixed by adding a `VAR_KEYWORD` argument to the calbacks, i.e., by
adding a single `**kwargs` argument at the end of the signature. This commit
adds a check that such a catch-all argument exists, and emits a warning if it
doesn't.

It also fixes up the plugins that we ship ourselves.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2019-08-05 00:19:48 +00:00
darosior 12e28c2554 lightningd/plugin: Add a 'dynamic' field to getmanifest and a 'startup' field to init
This lets a plugin specify whether it can be restarted, and to know if it is started at lightningd startup
2019-07-28 07:24:04 +00:00
darosior 9ddc2e0334 Add the 'plugin' subcommands to pylightning and add a test for them 2019-07-28 07:24:04 +00:00
darosior 34533ead68 Plugins: Add a test for the 'invoice_payment' notfication 2019-07-25 11:19:47 +08:00
lisa neigut a6516f477b bash-completion: include underscores
`fundchannel_start` etc are not included in the bash-completion as
they include underscores in their names. this fixes this by including
underscores.
2019-07-09 13:23:14 +02:00
darosior 7ea5c5c00f Pylightning: allow to set description and long description manually
This just adds the possibility to set a command's descriptionS by hand, so that the method docstring can be used for something else
2019-07-02 19:30:50 +02:00
Jorge Timón 83f2ccd9fd pylightning: Add new listtransactions command
[ FIXUP: Uninitialized var response used as context, changed to cmd --RR ]
2019-06-22 04:24:02 +00:00
lisa neigut c00e0d2936 funding: rename fundchannel_continue -> _complete
Renaming. "complete" more accurately describes what we're doing here.
2019-06-12 02:22:43 +00:00
lisa neigut 5aad642c59 opening: add fundchannel_cancel command
Provide the option to cancel a funding-opening with a peer.
Must either call `fundchannel_cancel` or `fundchannel_continue`
2019-06-12 02:22:43 +00:00
lisa neigut 7ea21c36b1 fundchannel: add txout field to RPC/API
We'll need the outpoint for the funding output.
2019-06-12 02:22:43 +00:00
lisa neigut dd11d3bd81 lightningd: add start for fundchannel_continue
Add an RPC method (not working at the moment) called
`fundchannel_continue` that takes as its parameters a
node_id and a txid for a transaction (that ostensibly has an output
for a channel)
2019-06-12 02:22:43 +00:00
lisa neigut 23e7846053 pylightning: add fundchannel_start
Add method to rpc handler
2019-06-12 02:22:43 +00:00
Rusty Russell adc4bf1817 pylightning: remove 0.6.2 JSON compat wedge.
The next commit breaks it: `if b' }\n' not in buff:` is always true since
we're about to clean up our JSON so there won't be a space.  I could have
hacked the space in our JSON, but 6 months is long enough anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-06-12 02:00:15 +00:00
darosior 1b29b063b2 fundchannel: Update the manpage and Pylightning's method
Add the new 'utxo' parameter to both
2019-06-11 23:24:07 +00:00
Rusty Russell 403b861fc7 pylightning: interfaces for txprepare/txsend/txdiscard.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-06-06 04:47:44 +00:00
Christian Decker 2b81e02a2e plugin: Parse response for htlc_accepted hook
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2019-06-04 00:27:15 +00:00
Christian Decker bf53821f1a plugin: Populate the request for the htlc_accepted hook
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2019-06-04 00:27:15 +00:00
Christian Decker b54577041a pytest: Add a simple test for the hooks
This uses the `htlc_accepted` hook to delay payment acceptance.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2019-06-04 00:27:15 +00:00
darosior 3775a32659 Pylightning: allow to specify the option type at its creation 2019-06-03 00:06:12 +00:00
darosior 78326a8d90 Pylightning: Allow a plugin to set the category of the RPC commands it creates 2019-06-03 00:02:25 +00:00
lisa neigut be502a095d devscript: always clean up pid files for lightning daemons 2019-05-24 16:06:35 +02:00
Michael Schmoock 0efd72d882 test: pylightning to_approx_str 2019-05-22 22:13:06 +02:00
Michael Schmoock d8599e5f67 pylightning: adds msat.to_approx_str() method
Tries to return the approxmost posible string of a Millisatoshi amount using
various unit representations. The function will round to an effective
number of digits. Default: 3.

```
>>> Millisatoshi("100000sat").to_approx_str()
'0.001btc'
>>> Millisatoshi("100msat").to_approx_str()
'0.1sat'
>>> Millisatoshi("10000000sat").to_approx_str()
'0.1btc'
```
2019-05-22 22:13:06 +02:00
Rusty Russell ee303e4a94 contrib: fix up bash completion script.
$ lightning-cli <TAB><TAB>
autocleaninvoice               dev-slowcmd                    listinvoices
check                          dev-suppress-gossip            listnodes
close                          disconnect                     listpayments
connect                        feerates                       listpays
decodepay                      fundchannel                    listpeers
delexpiredinvoice              getinfo                        listsendpays
delinvoice                     getlog                         newaddr
dev-compact-gossip-store       getroute                       -o
dev-crash                      -h                             --order
dev-fail                       -H                             pay
dev-forget-channel             --help                         paystatus
dev-ignore-htlcs               help                           ping
dev-listaddrs                  --human-readable               --rpc-file
dev-memdump                    invoice                        sendpay
dev-memleak                    -J                             setchannelfee
dev-query-channel-range        --json                         stop
dev-query-scids                -k                             -V
dev-reenable-commit            --keywords                     --version
dev-rescan-outputs             --lightning-dir                waitanyinvoice
dev-rhash                      listchannels                   waitinvoice
dev-send-timestamp-filter      listconfigs                    waitsendpay
dev-set-max-scids-encode-size  listforwards                   withdraw
dev-sign-last-tx               listfunds

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-05-22 00:46:54 +00:00
darosior 862ae87389 Fix bash completion 2019-05-22 00:46:54 +00:00
darosior 67d20ae842 Add 'paystatus' method 2019-05-18 22:18:39 +02:00
darosior a7ef7b47c8 Pylightning: add 'listconfigs' and 'listsendpays' RPC methods, correct 'invoice' docstring 2019-05-18 22:18:39 +02:00
Sjors Provoost b95e10c354 systemd: wait until network is up
Prevents error when launching with bind-addr.
2019-05-16 19:30:38 +02:00
darosior 12f703eb82 pylightning: Add missing RPC command as LightningRpc methods
Added 'autocleaninvoice', 'check', 'setchannelfee'
2019-05-13 21:11:53 +02:00
darosior efecd64bf3 pylightning: Reorder LightningRpc methods alphabetically 2019-05-13 21:11:53 +02:00
darosior b7279e9130 Add 'delexpiredinvoice' to pylightning 2019-05-11 17:11:01 +02:00
Christian Decker ff5dfb1cc4 pylightning: Clean up the argument binding
We had a bit of a hand-woven mess in there, trying to inject the extra
arguments in the correct places. We now instead treat positional and keyword
calls separately and can go back to using the builtin argument binding again.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2019-05-10 23:07:49 +00:00
Michael Schmoock 1e0aa9329d fix: pylightning to_btc_str precision
The old codes if % 1000 statement logic was simply inverted
and produced the opposite output of the intention behin it.

Before Fix:
 - Millisatoshi('42sat').to_btc_str() => 0.00000042000btc
 - Millisatoshi('42001msat').to_btc_str() => 0.00000042btc

After  Fix:
 - Millisatoshi('42sat').to_btc_str() => 0.00000042btc
 - Millisatoshi('42001msat').to_btc_str() => 0.00000042001btc
2019-05-08 18:18:19 -05:00
Christian Decker eeecfc983c plugin: Remove autopatch argument from helloworld plugin
Suggested-by: Rusty Russell <@rustyrussell>
2019-04-30 17:56:09 -05:00
Michael Schmoock f99c461fed fix: pylightning msat round multiply and division
Currently, when a multiplication operator is invoked that
does not result in an even integer result but a floating result,
the pylightning code will raise an exception:

Millisatoshi must be string with msat/sat/btc suffix or int

This is because the internal float result will be used as
contructor argument like this:  return Millisatoshi(10000.5)

This happens especially on fee calculations where small uneven amounts
are calculated.
2019-04-29 19:10:56 +02:00