Skip to content

Commit

Permalink
doc: manpages for the various lightning RPC calls.
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Sep 6, 2016
1 parent ab125f7 commit 2452df3
Show file tree
Hide file tree
Showing 16 changed files with 1,003 additions and 5 deletions.
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ GEN_HEADERS := gen_pkt_names.h \

CDUMP_OBJS := ccan-cdump.o ccan-strmap.o

MANPAGES := doc/lightning-cli.1 \
doc/lightning-delinvoice.7 \
doc/lightning-getroute.7 \
doc/lightning-invoice.7 \
doc/lightning-listinvoice.7 \
doc/lightning-sendpay.7 \
doc/lightning-waitinvoice.7

PROGRAMS := $(TEST_PROGRAMS)

CWARNFLAGS := -Werror -Wall -Wundef -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wold-style-definition
Expand All @@ -177,7 +185,10 @@ CFLAGS := $(CWARNFLAGS) $(CDEBUGFLAGS) -I $(CCANDIR) -I secp256k1/include/ -I .
LDLIBS := -lprotobuf-c -lgmp -lsodium -lbase58 -lsqlite3
$(PROGRAMS): CFLAGS+=-I.

default: $(PROGRAMS) daemon-all
default: $(PROGRAMS) $(MANPAGES) daemon-all

$(MANPAGES): doc/%: doc/%.txt
a2x --format=manpage $<

# Everything depends on the CCAN headers.
$(CCAN_OBJS) $(CDUMP_OBJS) $(HELPER_OBJS) $(BITCOIN_OBJS) $(TEST_PROGRAMS:=.o): $(CCAN_HEADERS)
Expand Down Expand Up @@ -325,6 +336,7 @@ maintainer-clean: distclean
@echo 'deletes files that may need special tools to rebuild.'
$(RM) lightning.pb-c.c lightning.pb-c.h ccan/config.h $(GEN_HEADERS)
$(RM) doc/deployable-lightning.pdf
$(RM) $(MANPAGES)

clean: daemon-clean
$(MAKE) -C secp256k1/ clean || true
Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ the original "lightning network").
This implementation is being developed in parallel with the protocol
definition, which you can find [on my fork of the protocol description repository](https://github.com/rustyrussell/lightning).

So far, we are working on the [inter-node encryption](https://github.com/rustyrussell/lightning-rfc/blob/master/bolts/01-encryption.md) and [transaction negotiation](https://github.com/rustyrussell/lightning-rfc/blob/master/bolts/02-wire-protocol.md) phases.
If you're interested in using the daemon to test payments, the
JSON-RPC interface is documented in the following manual pages:
* [invoice](doc/lightning-invoice.7.txt)
* [listinvoice](doc/lightning-listinvoice.7.txt)
* [waitinvoice](doc/lightning-waitinvoice.7.txt)
* [delinvoice](doc/lightning-delinvoice.7.txt)
* [getroute](doc/lightning-getroute.7.txt)
* [sendpay](doc/lightning-sendpay.7.txt)

Later steps will enhance the protocol to network individual daemons,
advertise their IP addresses, publish routes and fees, and use that
information to pay specific nodes. These details are currently being
So far, we have [inter-node encryption](https://github.com/rustyrussell/lightning-rfc/blob/master/bolts/01-encryption.md) and [transaction negotiation](https://github.com/rustyrussell/lightning-rfc/blob/master/bolts/02-wire-protocol.md).

Routing between non-adjacent nodes is currently done manually using the 'dev-addroute' command; later on daemons will
advertise their IP addresses, and publish routes and fees. These details are currently being
hashed out on the [mailing list](https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev) and the IRC channel [#lightning-dev](https://botbot.me/freenode/lightning-dev/) on Freenode.

Final note: This is very much a testbed and work in progress; expect
Expand Down
81 changes: 81 additions & 0 deletions doc/lightning-cli.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
'\" t
.\" Title: lightning-cli
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 09/06/2016
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "LIGHTNING\-CLI" "1" "09/06/2016" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
lightning-cli \- Control lightning daemon
.SH "SYNOPSIS"
.sp
\fBlightning\-cli\fR [\fIOPTIONS\fR] \fIcommand\fR\&...
.SH "DESCRIPTION"
.sp
\fBlightning\-cli\fR sends commands to the lightning daemon\&.
.SH "OPTIONS"
.PP
\fB\-\-lightning\-dir\fR=\fIDIR\fR
.RS 4
Set the directory for the lightning daemon we\(cqre talking to; defaults to
\fI$HOME/\&.lightning\fR\&.
.RE
.PP
\fB\-\-rpc\-file\fR=\fIFILE\fR
.RS 4
Named pipe to use to to talk to lightning daemon: default is
\fIlightning\-rpc\fR
in the lightning directory\&.
.RE
.PP
\fB\-\-help\fR/\fB\-h\fR
.RS 4
Print summary of options to standard output and exit\&.
.RE
.PP
\fB\-\-version\fR/\fB\-V\fR
.RS 4
Print version number to standard output and exit\&.
.RE
.SH "COMMANDS"
.sp
\fIlightning\-cli\fR simply uses the JSON RPC interface to talk to \fIlightningd\fR, and prints the results\&. Thus the commands available depend entirely on the lightning daemon itself\&.
.SH "EXAMPLES"
.PP
\fBExample\ \&1.\ \&List commands\fR
.sp
lighting\-cli help
.SH "BUGS"
.sp
This manpage documents how it should work, not how it does work\&. The pretty printing of results isn\(cqt pretty\&.
.SH "AUTHOR"
.sp
Rusty Russell <rusty@rustcorp\&.com\&.au> is mainly to blame\&.
.SH "RESOURCES"
.sp
Main web site: https://github\&.com/ElementsProject/lightning
.SH "COPYING"
.sp
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\&.
60 changes: 60 additions & 0 deletions doc/lightning-cli.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
LIGHTNING-CLI(1)
==================
:doctype: manpage

NAME
----
lightning-cli - Control lightning daemon


SYNOPSIS
--------
*lightning-cli* ['OPTIONS'] 'command'...

DESCRIPTION
-----------
*lightning-cli* sends commands to the lightning daemon.

OPTIONS
-------
*--lightning-dir*='DIR'::
Set the directory for the lightning daemon we're talking to; defaults to
'$HOME/.lightning'.
*--rpc-file*='FILE'::
Named pipe to use to to talk to lightning daemon: default is 'lightning-rpc'
in the lightning directory.
*--help*/*-h*::
Print summary of options to standard output and exit.
*--version*/*-V*::
Print version number to standard output and exit.

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.

EXAMPLES
--------
.List commands
===================================================================
lighting-cli help
===================================================================

BUGS
----
This manpage documents how it should work, not how it does work. The
pretty printing of results isn't pretty.

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.
49 changes: 49 additions & 0 deletions doc/lightning-delinvoice.7
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
'\" t
.\" Title: lightning-delinvoice
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 09/06/2016
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "LIGHTNING\-DELINVOIC" "7" "09/06/2016" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
lightning-delinvoice \- Protocol for removing an unpaid invoice\&.
.SH "SYNOPSIS"
.sp
\fBdelinvoice\fR \fIlabel\fR
.SH "DESCRIPTION"
.sp
The \fBdelinvoice\fR RPC command removes an unpaid invoice\&. The caller should be particularly aware of the error case caused by a payment just before this command is invoked!
.SH "RETURN VALUE"
.sp
On success, the \fIrhash\fR, \fIlabel\fR and \fImsatoshi\fR will be returned\&.
.SH "AUTHOR"
.sp
Rusty Russell <rusty@rustcorp\&.com\&.au> is mainly responsible\&.
.SH "SEE ALSO"
.sp
lightning\-listinvoice(7), lightning\-waitinvoice(7), lightning\-invoice(7)\&.
.SH "RESOURCES"
.sp
Main web site: https://github\&.com/ElementsProject/lightning
35 changes: 35 additions & 0 deletions doc/lightning-delinvoice.7.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
LIGHTNING-DELINVOICE(7)
=======================
:doctype: manpage

NAME
----
lightning-delinvoice - Protocol for removing an unpaid invoice.

SYNOPSIS
--------
*delinvoice* 'label'

DESCRIPTION
-----------
The *delinvoice* RPC command removes an unpaid invoice. The caller
should be particularly aware of the error case caused by a payment
just before this command is invoked!

RETURN VALUE
------------
On success, the 'rhash', 'label' and 'msatoshi' will be returned.

//FIXME:Enumerate errors

AUTHOR
------
Rusty Russell <rusty@rustcorp.com.au> is mainly responsible.

SEE ALSO
--------
lightning-listinvoice(7), lightning-waitinvoice(7), lightning-invoice(7).

RESOURCES
---------
Main web site: https://github.com/ElementsProject/lightning
Loading

0 comments on commit 2452df3

Please sign in to comment.