2019-08-31 14:30:56 +02:00
|
|
|
lightning-cli -- Control lightning daemon
|
|
|
|
=========================================
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
|
|
|
|
2021-10-24 11:44:56 +02:00
|
|
|
**lightning-cli** \[*OPTIONS*\] *command*
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
|
|
|
|
**lightning-cli** sends commands to the lightning daemon.
|
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
|
|
|
|
|
|
|
**--lightning-dir**=*DIR*
|
2021-10-24 11:44:56 +02:00
|
|
|
Set the directory for the lightning daemon we're talking to; defaults to
|
2019-08-10 01:54:18 +02:00
|
|
|
*$HOME/.lightning*.
|
|
|
|
|
2019-11-23 02:45:53 +01:00
|
|
|
**--conf**=*PATH*
|
|
|
|
Sets configuration file (default: **lightning-dir**/*config* ).
|
|
|
|
|
|
|
|
**--network**=*network*
|
|
|
|
**--mainnet**
|
|
|
|
**--testnet**
|
|
|
|
**--signet**
|
|
|
|
Sets network explicitly.
|
|
|
|
|
2019-08-10 01:54:18 +02:00
|
|
|
**--rpc-file**=*FILE*
|
|
|
|
Named pipe to use to talk to lightning daemon: default is
|
|
|
|
*lightning-rpc* in the lightning directory.
|
|
|
|
|
|
|
|
**--keywords**/**-k**
|
|
|
|
Use format *key*=*value* for parameters in any order
|
|
|
|
|
|
|
|
**--order**/**-o**
|
|
|
|
Follow strictly the order of parameters for the command
|
|
|
|
|
|
|
|
**--json**/**-J**
|
2020-05-11 03:11:51 +02:00
|
|
|
Return result in JSON format (default unless *help* command,
|
|
|
|
or result contains a `format-hint` field).
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
**--raw**/**-R**
|
2020-05-11 03:11:51 +02:00
|
|
|
Return raw JSON directly as lightningd replies; this can be faster for
|
|
|
|
large requests.
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
**--human-readable**/**-H**
|
2020-05-11 03:11:51 +02:00
|
|
|
Return result in human-readable output.
|
|
|
|
|
|
|
|
**--flat**/**-F**
|
|
|
|
Return JSON result in flattened one-per-line output, e.g. `{ "help":
|
|
|
|
[ { "command": "check" } ] }` would become `help[0].command=check`.
|
|
|
|
This is useful for simple scripts which want to find a specific output
|
|
|
|
field without parsing JSON.
|
2019-08-10 01:54:18 +02:00
|
|
|
|
2020-10-12 07:33:50 +02:00
|
|
|
**--notifications**/**-N**=*LEVEL*
|
|
|
|
If *LEVEL* is 'none', then never print out notifications. Otherwise,
|
|
|
|
print out notifications of *LEVEL* or above (one of `io`, `debug`,
|
|
|
|
`info` (the default), `unusual` or `broken`: they are prefixed with `#
|
|
|
|
`.
|
|
|
|
|
2019-08-10 01:54:18 +02:00
|
|
|
**--help**/**-h**
|
2020-05-11 03:11:51 +02:00
|
|
|
Pretty-print summary of options to standard output and exit. The format can
|
|
|
|
be changed using -F, -R, -J, -H etc.
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
**--version**/**-V**
|
|
|
|
Print version number to standard output and exit.
|
|
|
|
|
2019-11-23 02:46:58 +01:00
|
|
|
**allow-deprecated-apis**=*BOOL*
|
|
|
|
Enable deprecated options. It defaults to *true*, but you should set
|
2021-10-24 11:44:56 +02:00
|
|
|
it to *false* when testing to ensure that an upgrade won't break your
|
2019-11-23 02:46:58 +01:00
|
|
|
configuration.
|
|
|
|
|
2019-08-10 01:54:18 +02:00
|
|
|
COMMANDS
|
|
|
|
--------
|
|
|
|
|
|
|
|
*lightning-cli* simply uses the JSON RPC interface to talk to
|
|
|
|
*lightningd*, and prints the results. Thus the commands available depend
|
|
|
|
entirely on the lightning daemon itself.
|
|
|
|
|
|
|
|
ARGUMENTS
|
|
|
|
---------
|
|
|
|
|
|
|
|
Arguments may be provided positionally or using *key*=*value* after the
|
2021-02-06 15:21:13 +01:00
|
|
|
command name, based on either **-o** or **-k** option. When using **-k**
|
|
|
|
consider prefixing all arguments of the command with their respective keyword,
|
|
|
|
this is to avoid having lightningd intrepret the position of an arguement.
|
|
|
|
|
|
|
|
Arguments may be integer numbers (composed entirely of digits), floating-point
|
|
|
|
numbers (has a radix point but otherwise composed of digits), *true*, *false*,
|
2022-04-06 03:54:09 +02:00
|
|
|
or *null*. Arguments which begin with *{*, *[* or *"* are also considered
|
|
|
|
raw JSON and are passed through. Other arguments are treated as strings.
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
Some commands have optional arguments. You may use *null* to skip
|
2021-02-06 15:21:13 +01:00
|
|
|
optional arguments to provide later arguments, although this is not encouraged.
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
EXAMPLES
|
|
|
|
--------
|
|
|
|
|
2021-02-06 15:21:13 +01:00
|
|
|
1. List commands
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
lightning-cli help
|
|
|
|
|
2021-02-06 15:21:13 +01:00
|
|
|
2. Fund a 10k sat channel using uncomfirmed outputs
|
|
|
|
|
|
|
|
lightning-cli --keywords fundchannel id=028f...ae7d amount=10000sat minconf=0
|
|
|
|
|
2019-08-10 01:54:18 +02:00
|
|
|
BUGS
|
|
|
|
----
|
|
|
|
|
|
|
|
This manpage documents how it should work, not how it does work. The
|
2021-10-24 11:44:56 +02:00
|
|
|
pretty printing of results isn't pretty.
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
AUTHOR
|
|
|
|
------
|
|
|
|
|
|
|
|
Rusty Russell <<rusty@rustcorp.com.au>> is mainly to blame.
|
|
|
|
|
|
|
|
RESOURCES
|
|
|
|
---------
|
|
|
|
|
|
|
|
Main web site: <https://github.com/ElementsProject/lightning>
|
|
|
|
|
|
|
|
COPYING
|
|
|
|
-------
|
|
|
|
|
|
|
|
Note: the modules in the ccan/ directory have their own licenses, but
|
|
|
|
the rest of the code is covered by the BSD-style MIT license.
|
2020-08-25 03:33:16 +02:00
|
|
|
|